LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-09-2010, 08:17 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,125

Rep: Reputation: 46
A question about shell scripts.


Hi:

Code:
CODECSDIR=${CODECSDIR:-/usr/lib/codecs}
Could somebody tell me what the value of CODECSDIR will be after the line is executed/interpreted? This is the first time in the script where the variable CODECSDIR appears. Thanks in advance.

EDIT: also, when I am in the prompt, echo $CODECSDIR outputs nothing.

Last edited by stf92; 08-09-2010 at 08:21 PM.
 
Old 08-09-2010, 08:42 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,087

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Because $CODECSDIR didn't exist yet it has been assigned a deafult value.

http://tldp.org/LDP/abs/html/refcards.html#AEN22008

Code:
jlinkels@jlinkels-lt:/tmp$ CODECSDIR=${CODECSDIR:-/usr/lib/codecs}
jlinkels@jlinkels-lt:/tmp$ echo $CODECSDIR
/usr/lib/codecs
jlinkels
 
1 members found this post helpful.
Old 08-09-2010, 09:01 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,125

Original Poster
Rep: Reputation: 46
Thank you. Your post has been very useful. Regards.
 
  


Reply

Tags
scripts


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question regarding start-up shell scripts pjdlmack Linux - Newbie 3 10-16-2009 12:23 AM
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 06:24 AM
Need help with shell scripts gudum35 Programming 11 02-23-2006 06:32 AM
shell scripts rocketgo Linux - General 10 12-01-2003 05:20 AM
shell scripts nautilus_1987 Linux - General 3 08-30-2002 03:12 AM


All times are GMT -5. The time now is 12:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration