Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] bash date puzzle
Date: Mon, 14 Nov 2011 12:09:18
Message-Id: 20111114120806.11ed0220@zaphod.digimed.co.uk
In Reply to: Re: [gentoo-user] bash date puzzle by Philip Webb
1 On Mon, 14 Nov 2011 06:13:34 -0500, Philip Webb wrote:
2
3 > > It is difficult to say what is wrong with your alias
4 > > as you haven't shown it
5 >
6 > alias th='date -d @$1'
7 >
8 > was the first try, then adding '+' &/or '\' to escape '+' or '@'.
9 > I also tried a function along similar lines.
10 >
11 > > but my guess is that is is introducing a space
12 > > between @ and the timestamp, which gives exactly the error you get.
13 >
14 > No, no spaces.
15
16 You invoke it as 'alias argument', so there is a space between the alias
17 and the argument and this space is included when the alias is expanded.
18 Otherwise aliases like ll='ls -l' would not work as 'll /mnt' would be
19 expanded to 'ls -l/mnt'.
20
21
22 --
23 Neil Bothwick
24
25 My brain's in gear, neutral's a gear ain't it?

Attachments

File name MIME type
signature.asc application/pgp-signature