SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The syntax of ${TMP:-/tmp/SBo} means that if the $TMP variable exists in the parent environment then use that value otherwise assign the value of the variable to (in this case) /tmp/SBo.
Assigning a value to $TMP in one of several places is straightforward (~/.bashrc, /etc/bashrc, /etc/profile.d, etc.).
I would like to assign the OUTPUT variable to $CWD. Yet $CWD is unknown to the parent environment and unknown until I run the build script.
I can:
1. Manually edit the script to OUTPUT=$CWD.
2. Start the script with OUTPUT=$(pwd) sh buildscript
I would never remember option 2 all the time. Therefore I always edit build scripts with option 1. I've been doing that for a long time, but I wonder whether a more clever method exists so could run these scripts as is without manually editing.
Is there a way to programmatically assign OUTPUT globally so all I need do is change to the build directory and type sh buildscript?
Is there a way to programmatically assign OUTPUT globally so all I need do is change to the build directory and type sh buildscript?
You could create a simple script especially for executing slackbuilds with your environment settings (and based on the current directory at time of invocation).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.