Tagged Questions
3
votes
2answers
90 views
sourcing a file inside a script
I'd like to source a file inside a tcsh script. In code:
#!/bin/tcsh
unsetenv LD_LIBRARY_PATH
source $1
echo $LD_LIBRARY_PATH > temp_file
The expected result: The environment variable set ...
1
vote
3answers
96 views
Accessing bash [internal] brace expansion iteration number/variable
Question:
Is it possible to access which number of a bash iteration is currently being processed?
Psuedo-Command
mv {1..5}.something.{1..5} $x1.$x2.something
Note: This is a logical ...
0
votes
1answer
67 views
Shell script executing in the terminal but not from shell script file [closed]
Possible Duplicate:
How can I make variables “exported” in a bash script stick around?
I have a problem with executing script from file. When I type in command line
...
2
votes
2answers
136 views
Set Variable Environment Variables in bash (or other)
I want my script to read a file containing key/value pairs of environment variables to set, and then to set them.
So far, I have this:
#!/bin/bash
cat $1 | while read kv
do
key=${kv%=*}
...
4
votes
3answers
452 views
How to set global environment variables at boot through a script, and have them available for an application that runs before login?
I have a service that runs at boot, and in that service it calls a bash script in the background that exports some environment variables. The problem I'm having is that those environment variables ...
8
votes
4answers
288 views
keep duplicates out of $PATH on source
I have the following code that's source-d by my .shellrc
PATH="${PATH}:${HOME}/perl5/bin"
PATH="${PATH}:${HOME}/.bin"
export PATH
but if I make changes to other code and then source this file, my ...
11
votes
2answers
608 views
$VAR vs ${VAR} and to quote or not to quote
I can write
VAR=$VAR1
VAR=${VAR1}
VAR="$VAR1"
VAR="${VAR1}"
the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?