Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Stroller
On 14 November 2011, at 07:06, Philip Webb wrote: > To convert a UNIX date to a human-readable version the command is : > > 556: ~> date -d @1321251520 > Mon Nov 14 01:18:40 EST 2011 > > I would like to create a Bash alias or function to do this, > but can't get the Bash syntax right: it keep

Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Philip Webb
14 Willie Wong wrote: > On Mon, Nov 14, 2011 at 06:13:34AM -0500, Philip Webb wrote: >> alias th='date -d @$1' > That is not how you use alias. > What you want is to use a function. Replace the alias line by > function th { date -d @$1; } > in your bashrc you'l probably be ok. That's wha

Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Neil Bothwick
On Mon, 14 Nov 2011 06:13:34 -0500, Philip Webb wrote: > > It is difficult to say what is wrong with your alias > > as you haven't shown it > > alias th='date -d @$1' > > was the first try, then adding '+' &/or '\' to escape '+' or '@'. > I also tried a function along similar lines. > > > b

Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Philip Webb
14 Neil Bothwick wrote: > On Mon, 14 Nov 2011 02:06:04 -0500, Philip Webb wrote: >> To convert a UNIX date to a human-readable version the command is : >> 556: ~> date -d @1321251520 >> Mon Nov 14 01:18:40 EST 2011 >> I would like to create a Bash alias or function to do this, >> but can't

Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Willie Wong
On Mon, Nov 14, 2011 at 06:13:34AM -0500, Philip Webb wrote: > alias th='date -d @$1' > > was the first try, then adding '+' &/or '\' to escape '+' or '@'. > I also tried a function along similar lines. > That is not how you use alias. What you want is to use a function. Replace the alias li

Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Paul Colquhoun
On Mon, 14 Nov 2011 06:13:34 AM Philip Webb wrote: > 14 Neil Bothwick wrote: > > On Mon, 14 Nov 2011 02:06:04 -0500, Philip Webb wrote: > >> To convert a UNIX date to a human-readable version the command is : > >> 556: ~> date -d @1321251520 > >> Mon Nov 14 01:18:40 EST 2011 > >> > >> I wo

Re: [gentoo-user] bash date puzzle

2011-11-14 Thread Neil Bothwick
On Mon, 14 Nov 2011 02:06:04 -0500, Philip Webb wrote: > To convert a UNIX date to a human-readable version the command is : > > 556: ~> date -d @1321251520 > Mon Nov 14 01:18:40 EST 2011 > > I would like to create a Bash alias or function to do this, > but can't get the Bash syntax right:

[gentoo-user] bash date puzzle

2011-11-13 Thread Philip Webb
To convert a UNIX date to a human-readable version the command is : 556: ~> date -d @1321251520 Mon Nov 14 01:18:40 EST 2011 I would like to create a Bash alias or function to do this, but can't get the Bash syntax right: it keeps telling me "date: the argument `1321251520' lacks a leading