tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Better cron output handling?

grep ▻

Shell script help

In article <38e7df8b.6224447@news.demon.co.uk>,
David Lodge <usenet@muspellheim.demon.co.uk> wrote:
>>TEXT= echo -n $2 | head -c 10
>
>Here's your problem!
>The line above is setting TEXT to 'echo -n $2'

No it's not.  Whitespace is significant in Bourne shell variable
assignments.  The line shown sets TEXT to the empty string for the
duration of the command `echo -n $2 | head -c 10'.

Your proposed fix is correct, though.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: Shell script help
Date: 4 Apr 2000 12:54:35 +0100
Message-ID: <8ccl6h$n5n$1@ltpcg.star.le.ac.uk>
References: <38e7d4f4$0$79032@SSP1NO17.highway.telekom.at>
  <38e7df8b.6224447@news.demon.co.uk>

△ comp.unix.shell △

◅ Better cron output handling?

grep ▻