bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: ed: please give me a little control over appending final newlines


From: Andrew L. Moore
Subject: Re: ed: please give me a little control over appending final newlines
Date: Fri, 01 Mar 2002 10:16:10 -0800

In message <address@hidden>, Andreas Schwab writes:
>|>     if [ ."$@" = . ]; then ed "$TMP"; else ed "$@" "$TMP"; fi
>             ^^^^
>
>This will expand to more than one word if $# > 1, probably giving a
>syntax error from test.  The test is not nessary at all, just use the
>else branch unconditionally.

In the particular case of ed(1), "" is interpreted as an illegal file name.
The following evidently works:

if [ ."$*" = . ]; then ed "$TMP"; else ed "$@" "$TMP"; fi



reply via email to

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