On Thu, 2002-12-12 at 06:26, Bill Shirley wrote:
> I'm trying to make an bash alias do what I want an things are not
> working as
> expected.
>
> [root@server1 samba]# alias ta='echo /var/log/samba/log.${1:-smbd}'
> [root@server1 samba]# ta
> /var/log/samba/log.smbd
> [root@server1 samba]# ta server2
> /var/log/samba/log.smbd server2
>
> I would think the second invocation of ta to produce:
> /var/log/samba/log.server2
>
> but it doesn't. Is there something I don't understand?
Not sure what you want, but I can see that
echo /var/log/samba/log.${1:-smbd}
is going to produce
/var/log/samba/log.smbd
no matter what is in $1. If you want to process $1, you have to call it
in the alias:
alias ta=/var/log/samba/log.$1
That still inserts a space though, and I'm not sure how to remove it:
[jack@chupacabra jack]$ ta beavis
/var/log/samba/log. beavis
--
Jack Coates
Monkeynoodle: A Scientific Venture...
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com