LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 02-23-2009, 06:11 AM   #1
bines
Member
 
Registered: Dec 2008
Location: Hereford, UK
Distribution: LFS (when it's finished)
Posts: 30

Rep: Reputation: 16
BLFS /etc/profile help please


I've added the bash shell scripts to my new LFS exactly as per the book (version 6.3).

The PATH does not get /sbin:/usr/bin appended to it - even though $EUID is zero. I am logged in as root user, there are no other users created as yet.

I'm trying to understand the script in /etc/profile to see what's not happening but I don't understand the line: local PATHVARIABLE=${2:-PATH}

Please can someone tell me what this line does exactly, it's the {2:-PATH} bit I don't understand. I can't find anything like this in any books or tutorials, but maybe - until I know the answer - I don't know exactly where to look!!

Thanks
 
Old 02-23-2009, 08:02 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
${2:-PATH} is an example of parameter substitution, which in this case sets a default value for the variable. It says to use the $2 positional parameter if it exists, or to use whatever follows the ":-" if it doesn't. I'm not sure what "PATH" is here though. Since it's not being called as a variable, it would just be interpreted as a literal string. Perhaps it should be $PATH instead?

Not knowing anything about LFS or how you configure the startup scripts with it, I can't tell you more than that.
 
Old 02-23-2009, 11:43 AM   #3
bines
Member
 
Registered: Dec 2008
Location: Hereford, UK
Distribution: LFS (when it's finished)
Posts: 30

Original Poster
Rep: Reputation: 16
Hi David the H. Very many thanks for your explanation, I understand now and it all starts to make sense!

Another little bit learned!

I'm most grateful for your time.

bines
 
  


Reply



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
ALFS profile for BLFS-6.1 Vitalie Ciubotaru Linux From Scratch 0 07-10-2006 03:07 PM
system profile vs user profile bonito SUSE / openSUSE 3 06-28-2006 01:02 PM
I need BLFS !!! nykey Linux From Scratch 1 06-06-2006 07:05 PM
LFS or BLFS masand Linux From Scratch 16 12-02-2004 02:31 PM
On to BLFS itsjustme Linux From Scratch 7 09-01-2003 04:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 04:36 AM.

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
Open Source Consulting | Domain Registration