[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Nov 2009 ]

Re: [edlug] Shell Script Problem



On Mon, 2009-11-30 at 21:24 +0000, Leo Butler wrote:
> <  if [ "$result" == "D" ]
> <   then
> <   session=dellgx280
> <  fi
> < 
> <  Which I would like to compress into a single line to clarify the
> <  script.  How would I achieve this...?
>  
> [ "$result" == "D" ] && session=dellgx280 

you could also be a little more verbose
if [ "$result" == "D" ]; then session=dellgx280; fi

although I prefer Leo's suggestion.

magi


-
----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble+RM@xxx.xxx.xxx
Morpheux
HomePage