1 |
Peper wrote: |
2 |
> Hello, |
3 |
> I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how can |
4 |
> i change it to 'output of pwd/blah' ? |
5 |
|
6 |
I'm not quiet sure what you mean with "output of pwd/blah". |
7 |
|
8 |
If you want to assign "/home/me/blah" (or whatever your current |
9 |
directory is) you may use the environemnt variable $PWD and the |
10 |
expression would read as: |
11 |
|
12 |
blah=${PWD}/blah |
13 |
|
14 |
If you insist to use the comand pwd you may write: |
15 |
|
16 |
blah=`pwd`/blah or blah=$(pwd)/bla |
17 |
|
18 |
If you want to assign the content of /home/me/blah to your variable use cat: |
19 |
|
20 |
blah=`cat ${PWD}/blah` or blah=$(cat ${PWD}/blah) |
21 |
|
22 |
Matthias |
23 |
|
24 |
-- |
25 |
gentoo-user@g.o mailing list |