[ale] editing variables in bash (or shell)

Fletch fletch at phydeaux.org
Sat Mar 12 00:01:12 EST 2005


>>>>> "Asif" == Asif E <asifem at gmail.com> writes:

    Asif> Maybe dest_file_name=`echo $src_file_name | sed 's%/%-%g'`

Of course if you use zsh this can all be done without the backticks,
echo, and sed.

lemur:~ 715> foo="/a/b/c"
lemur:~ 716> echo ${${foo:s,/,,}:gs,/,-,}
a-b-c


See 'man zshexpn' for details.

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org|  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U



More information about the Ale mailing list