Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 2nd, 2007, 2:29 AM   #1
Emperor
Newbie
 
Join Date: Apr 2005
Posts: 10
Rep Power: 0 Emperor is on a distinguished road
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.
Emperor is offline   Reply With Quote
Old May 4th, 2007, 11:24 AM   #2
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
#Bourne shell
VARIABLE="something"
export VARIABLE
#ksh, zsh, bash
export VARIABLE="something"
OR in a pathname? Do you mean this
if [[ -d /path/one || -d /path/two ]] ; then
  echo "At least one of these two is a valid path"
fi
jim mcnamara is offline   Reply With Quote
Old Jun 27th, 2007, 7:39 PM   #3
Fourth
Newbie
 
Join Date: May 2007
Posts: 3
Rep Power: 0 Fourth is an unknown quantity at this point
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.
Fourth is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:44 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC