On Mon 08 Sep 2003 at 16:36:02, Grant Robinson said:
>
> Care to give a more detailed explanation on what the ${f## does?
Look up "Parameter Expansion" in the bash manpage. Just to give some
short examples:
$ THIS="some_variable_value"
$ echo ${THIS##*_}
value
$ echo ${THIS#*_}
variable_value
$ echo ${THIS%_*}
some_variable
$ echo ${THIS%%_*}
some
$ echo ${THIS/v/V}
some_Variable_value
$ echo ${THIS//v/V}
some_Variable_Value
$ echo ${THIS:3}
e_variable_value
$ echo ${THIS:3:8}
e_variab
Basically, # and ## chop matching globs off the front of the variable
value, and % and %% chop them off the end. The / is for replacement,
and : is for substrings. Just try playing with it a little.
--
Soren Harward
[EMAIL PROTECTED]
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list