T. Joseph CARTER wrote:
Allen, $() is not part of bourne shell, just for the record.
True. I should have made that clear. But neither is the
${variable##pattern} syntax. Both are first introduced
in korn shell (ksh) and adopted in bash.
--
Allen Brown [EMAIL PROTECTED] http://www.peak.org/
Thanks for the description. This helped, and also I found an IBM
article that explains the chopping stuff too:
http://www-128.ibm.com/developerworks/linux/library/l-bash.html
Thanks all,
Rob
Allen Brown wrote:
Rob Hudson wrote:
Looks like I can do:
path = `dirname $path` # for directory
pat
Allen, $() is not part of bourne shell, just for the record.
--
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit."
-- Aristotle
___
EUGLUG mailing list
euglug@euglug.org
http://www.euglug.org/mailman/listinfo/eug
Rob Hudson wrote:
Given a variable with something like this in it:
/Volumes/Projects/Testing/Simple_Carbon_App.pkg
I need to extract the base path to get:
/Volumes/Projects/Testing
basename will give you the name of the file, and dirname will give you
the path:
$ basename /Volumes/Project
Rob Hudson wrote:
Looks like I can do:
path = `dirname $path` # for directory
path = `basename $path` # similar to path=${path##/*/}
Is this the best option?
That is a good option. It provides backward compatibility
with the boring shell (Bourne). However I prefer the $()
syntax since it pr
Rob Hudson wrote:
Given a variable with something like this in it:
/Volumes/Projects/Testing/Simple_Carbon_App.pkg
I need to extract the base path to get:
/Volumes/Projects/Testing
I found how to get the last part in an example, though I don't fully
understand what's going on. Assuming "path
Well, I'm not a bash expert, but personally I would use the following:
path=`dirname $path`
you might want to pull the man pages for "dirname" and "basename" which
are on most systems I've ever used and should do what you want with less
headache.
My quick test of my memory follows:
[EMAIL
Looks like I can do:
path = `dirname $path` # for directory
path = `basename $path` # similar to path=${path##/*/}
Is this the best option?
Rob Hudson wrote:
Given a variable with something like this in it:
/Volumes/Projects/Testing/Simple_Carbon_App.pkg
I need to extract the base path to get
Given a variable with something like this in it:
/Volumes/Projects/Testing/Simple_Carbon_App.pkg
I need to extract the base path to get:
/Volumes/Projects/Testing
I found how to get the last part in an example, though I don't fully
understand what's going on. Assuming "path" has the first volu
Just to clarify things before the questions get posted. Because of SAO
tonight, EUGLUG will not have any official clinic. There will however,
be an informal gathering for dinner of Euglugers (and anyone from SAO we
can talk into joinging us) following the SAO meeting. If anyone has
questions, pl
Apparently the reminder didn't go out as planned
SAO thing tonight at the Rogue, 5:30-7:30.
Intechgra doing presentation on their remote monitoring and Admin services.
Bring your resumes
Matthew S. Jarvis
IT Manager
Bike Friday - "Performance that Packs."
www.bikefriday.com
541/687-04
11 matches
Mail list logo