![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 10
Rep Power: 0
![]() |
Making a variable sub-shell accessible?
Hey guys, how do you make a variable accessible to a subshell? Also, do you use for OR aka || in a pathname? Is it ||? Thanks for any help.
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
#Bourne shell VARIABLE="something" export VARIABLE #ksh, zsh, bash export VARIABLE="something" if [[ -d /path/one || -d /path/two ]] ; then echo "At least one of these two is a valid path" fi |
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2007
Posts: 3
Rep Power: 0
![]() |
if you wanna specify OR in a conditional its -o i believe. i.e
if [ -d /path/one -o -d /path/two ] ; then echo "At least one of these two is a valid path" fi assuming thats what you are asking. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Beginers Python Tutorial | Beegie_B | Python | 15 | Jul 28th, 2006 11:43 AM |
| Compiling Maverik 6.2 (from C) | megamind5005 | C | 16 | May 3rd, 2006 5:41 PM |
| Pointers in C (Part II) | Stack Overflow | C | 2 | Apr 29th, 2005 10:39 AM |
| Pointers in C (Part I) | Stack Overflow | C | 4 | Apr 28th, 2005 7:03 PM |
| variable problem | robert_sun | C | 1 | Apr 12th, 2005 2:10 PM |