Tuesday, 21 April 2015

Write a shell program that checks the number of command line arguments

This also echoes an error message if there are not exactly three arguments or echoes the arguments themselves if there are three.

echo "No of command line arguments are: $#"
echo "*******"
if [ $# == 3 ];then
echo "Three arguments you entered are"
echo $1 $2 $3
echo "Error while processing arguments"

No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016