[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] editing variables in bash (or shell)
- Subject: [ale] editing variables in bash (or shell)
- From: fletch at phydeaux.org (Fletch)
- Date: Sat Mar 12 00:01:12 2005
- In-reply-to: <[email protected]> (Asif E.'s message of "Thu, 10 Mar 2005 16:24:33 -0500")
- References: <[email protected]> <[email protected]>
>>>>> "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