| Michael Tosch 2005-11-29, 5:58 pm |
| bernd wrote:
> Hello folks,
>
> the following is intended to check whether the loaded crontab is
> identical to the file stored on hard disk:
>
>
>
> crontab test1.txt test2.txt
>
>
> 13c13
> < 0,5,10,15,20,25,35,40,45,50,55 0,5-23 * * * $HOME/hellow.ksh
> ---
>
>
>
> So far, so good.
>
> As soon as I try to capture the result in a variable using backticks
> things turn out to be strange:
>
>
>
> 13c13 < 0,5,10,15,20,25,35,40,45,50,55 0,5-23 crontab test1.txt
> test2.txt
> crontab test1.txt test2.txt crontab test1.txt test2.txt
> $HOME/hellow.ksh--- > #0,5,10,15,20,25,35,40,45,50,550,5-23 crontab
> test1.txt test2.txt crontab test1.txt test2.txt crontab test1.txt
> test2.txt $HOME/hellow.ksh
>
> The variable $diff contains the output in one line, the content of the
> current directory interspersed into this line. Does somebody know the
> reason for this strange behaviour and a workaround ?
>
The diffs variable is correct. The problem occurs when the shell
parses the unquoted $diffs.
echo "$diffs"
and the shell treats the $diffs as a string.
--
Michael Tosch @ hp : com
|