On Sunday 29 July 2007 23:42, James Knott wrote:
>JK >> FM I'm having no luck figuring out why
>JK >> FM alias Vol='tune2fs -l $1 | grep volume'
>JK >> FM
>JK >> FM causes a usage message when 'Vol /dev/hda7' is run. Can anyone 
explain 
> JK FM>> what FM I'm doing wrong, or provide a better method to  discover a 
volume 
> JK FM>> label? 

>JK > I remember that $1 - is the first argument in bash scripts, but I don't
>JK > remember how $1 works in command line. And I think it will be a good
> idea to JK > try this:
<skipped>
>JK Actually, $0 is the first, which contains the command used to call it.
<skipped>

I mean that script works , but when we use pipelines is `alias` we can get 
unusual things. For example :

> alias test='echo $1 | grep qwerty; echo $1';
> test qwertyu
qwertyu

But if we write this code in script we'll get 
qwertyu
qwertyu

Thats why I use aliases only on simple commands and scripts on others.

-- 
WBR, Dmitry.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to