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 keeps telling me
> "date: the argument `1321251520' lacks a leading `+';

~ $ function foo {
> date -d @$1
> }
 ~ $ foo 1321251520
Mon Nov 14 06:18:40 GMT 2011
~ $ 

Copied and pasted literally from my terminal, which is why you see the ">" PS2 
continuation prompt on lines 2 & 3.

Stroller.



Reply via email to