LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 09:17 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,273

Rep: Reputation: 49
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 09:21 PM.
 
Old 08-09-2010, 09:42 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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, 10:01 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,273

Original Poster
Rep: Reputation: 49
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 01:23 AM
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 07:24 AM
Need help with shell scripts gudum35 Programming 11 02-23-2006 07:32 AM
shell scripts rocketgo Linux - General 10 12-01-2003 06:20 AM
shell scripts nautilus_1987 Linux - General 3 08-30-2002 04:12 AM


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

Main Menu
Advertisement
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