> * Eric Blake <[email protected]> [2011-08-15 16:59:29 -0600]:
>
> On 08/15/2011 04:40 PM, Sam Steingold wrote:
>>> * Andreas Schwab<[email protected]> [2011-08-15 22:04:04 +0200]:
>>>
>>> Sam Steingold<[email protected]> writes:
>>>
>>>> Cool. Now, what does this imply?
>>>
>>> "For almost every purpose, shell functions are preferred over aliases."
>>
>> so, how do I write
>>
>> alias a=b
>>
>> as a function?
>> (remember that arguments may contain spaces&c)
>
> a() { b "$@"; }
mkdir z
cd z
touch a b 'c d'
how do I write a function that would print the same as
$ \ls | cat
a
b
c d
$
$ f1(){ for a in "$*"; do echo $a; done; }
$ f1 *
a b c d
$
$ f2(){ for a in $*; do echo $a; done; }
$ f2 *
a
b
c
d
$
--
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X
11.0.60900031
http://ffii.org http://honestreporting.com http://www.memritv.org
http://thereligionofpeace.com http://mideasttruth.com http://dhimmi.com
UNIX is a way of thinking. Windows is a way of not thinking.