Monday 25 December 2017

shell - What is the difference between "$a" and $a in unix

For
example:



#!/bin/sh
a=0
while
[ "$a" -lt 10 ]
b="$a"
while [ "$b" -ge 0 ] do
echo -n
"$b "
b=`expr $b - 1`
done

echo

a=`expr $a +
1`
done*


The
above mentioned script gives the answer in triangle while with out the double quotes, it
falls one after the other on diff lines.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...