Gentoo Archives: gentoo-user

From: Philip Webb <purslow@××××××××.net>
To: Gentoo User <gentoo-user@l.g.o>
Subject: [gentoo-user] bash date puzzle
Date: Mon, 14 Nov 2011 07:07:10
Message-Id: 20111114070604.GA3152@ca.inter.net
1 To convert a UNIX date to a human-readable version the command is :
2
3 556: ~> date -d @1321251520
4 Mon Nov 14 01:18:40 EST 2011
5
6 I would like to create a Bash alias or function to do this,
7 but can't get the Bash syntax right: it keeps telling me
8 "date: the argument `1321251520' lacks a leading `+';
9 when using an option to specify date(s), any non-option
10 argument must be a format string beginning with `+'
11 Try `date --help' for more information".
12
13 I can't find any explanation for the '@' in the CLI version
14 nor do various attempts to insert '+', escape '\@' etc succeed.
15
16 Can anyone suggest a way to do this ?
17
18 --
19 ========================,,============================================
20 SUPPORT ___________//___, Philip Webb
21 ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto
22 TRANSIT `-O----------O---' purslowatchassdotutorontodotca

Replies

Subject Author
Re: [gentoo-user] bash date puzzle Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] bash date puzzle Stroller <stroller@××××××××××××××××××.uk>