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

Re: bash NEWBIE I/O and I/O redirection problems



On Mon, Oct 24, 2016 at 07:58:52AM -0500, Richard Owlett wrote:
>     blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048)

Use $(( ... )) for integer arithmetic.

blocks=$(( $(/sbin/isosize /dev/sr0) / 2048 ))

>     ls -l $FILENAME				;# to stdout AND "logfile"

Always quote properly.

ls -ld "$FILENAME"

References:

http://mywiki.wooledge.org/Quotes
http://mywiki.wooledge.org/ArithmeticExpression


Reply to: