bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting "date" command output w/o linefeed


From: Francis Montagnac
Subject: Re: Getting "date" command output w/o linefeed
Date: 29 Jul 2002 07:12:41 GMT

In article <address@hidden>,
 address@hidden (Andreas Schwab) writes:
>address@hidden (Reed Loefgren) writes:
>
>|> Is there a switch that will output the date without a linefeed?
>
>$ date | tr -d '\n'

Or using the fact that (from the bash manual):

   Bash performs the expansion by executing command and
   replacing  the command substitution with the standard out-
   put of the command, with any  trailing  newlines  deleted.
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

d=$(date)

echo -n "$d"

-- 
address@hidden, Tel: (33) 04 92 38 79 11, Bur: E106
INRIA Sophia, 2004, rte des Lucioles, B.P.93 - 06902 Sophia Antipolis Cedex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]