Gzip
Gzip
Syntax:
gzip[options] [file_name].
-l:Lists the size of the original file & the size after compression.
-r:Compresses directories recursively.If we specify a directory to compress,it will compress all the files stored in the sub-directories. -d:Decompresses the files.
Looping is used to execyte a set of commands repeatedly. To perform looping,you need to specify a set ofinitial conditions,the termination condition and the commands that need to be executed repeatedly. Looping structres are
syntax:
while <condition> do <command (s)> Done reply=y while test "$reply" != "n" do echo n "Enter file name?" read fname cat ${fname} echo n "wish to see more files :" read reply done
example
syntax:
Example
echo $a ((a=$a+1))
done o/p 110
The evaluation pattern of the until loop construct is opposite to that of the while loop.
Until construct execute until the specified condition is evaluates to false
o/p
1,2,3,..10
o/p
1,2,3,..10