On 16/06/09 22:06, david wrote:
Q1.why does sed lose the first line?
> cat blah | while read line ; do sed s/t/T/ ; done

Think about the return value of sed with no input. while swallows
the first line, then cat prints the rest.

You want this:
  cat blah | while read line ; do echo "$line" | sed s/t/T/ ; done
which will have trouble with some characters in the input.

I don't understand why you didn't choose a direct file redirection
rather than a pipe:
  sed s/t/T/ < blah

Q2. what does the @ mean?
> date -d @1174306440
I can't find a reference to @ in the date man page.

That man page says:

  The full documentation for date is maintained as a Texinfo manual.

Which indeed it is:

28.8 Seconds since the Epoch
============================

If you precede a number with `@', it represents an internal time stamp
as a count of seconds.  The number can contain an internal decimal
point (either `.' or `,'); any excess precision not supported by the
internal representation is truncated toward minus infinity.  Such a
number cannot be combined with any other date item, as it specifies a
complete time stamp.

   Internally, computer times are represented as a count of seconds
since an epoch--a well-defined point of time.  On GNU and POSIX
systems, the epoch is 1970-01-01 00:00:00 UTC, so `...@0' represents this
time, `...@1' represents 1970-01-01 00:00:01 UTC, and so forth...

--
 Glen Turner
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to