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 08:07:56
Message-Id: 20111114080609.35d6dac0@digimed.co.uk
In Reply to: [gentoo-user] bash date puzzle by Philip Webb
1 On Mon, 14 Nov 2011 02:06:04 -0500, Philip Webb wrote:
2
3 > To convert a UNIX date to a human-readable version the command is :
4 >
5 > 556: ~> date -d @1321251520
6 > Mon Nov 14 01:18:40 EST 2011
7 >
8 > I would like to create a Bash alias or function to do this,
9 > but can't get the Bash syntax right: it keeps telling me
10 > "date: the argument `1321251520' lacks a leading `+';
11 > when using an option to specify date(s), any non-option
12 > argument must be a format string beginning with `+'
13 > Try `date --help' for more information".
14
15 It is difficult to say what is wrong with your alias as you haven't shown
16 it, but my guess is that is is introducing a space between the @ and the
17 timestamp, which gives exactly the error you get.
18
19
20 --
21 Neil Bothwick
22
23 When companies ship Styrofoam, what do they pack it in?

Attachments

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

Replies

Subject Author
Re: [gentoo-user] bash date puzzle Philip Webb <purslow@××××××××.net>