OT: bash help

Joe Zeff joe at zeff.us
Sat Aug 16 21:55:15 UTC 2014


On 08/16/2014 02:44 PM, Mike Wright wrote:
> if [ -n $# ]
> then
>      WORDS=$1
> else
>      WORDS="these are some words"
> fi
> echo $WORDS;
>
> The second case is always comes back "".
>
> But if I write
>
> WORDS='these are some words'
> echo $WORDS
>
> I get the assigned string.

In your first example, you use full quotes (") but in your second, you 
use single (').  Try using single quotes and see if it makes a difference.


More information about the users mailing list