Programming Tutorials

(追記) (追記ここまで)

Command line arguments in Shell Script

By: Vivek G in Linux Tutorials on 2011年01月29日 [フレーム]

This shell script shows how to accept command line arguments in shell scripts. In this example it accepts two numbers and adds them.
if [ $# -ne 2 ]
then
 echo "Usage - 0ドル x y"
 echo " Where x and y are two nos for which I will print sum"
 exit 1
fi
 echo "Sum of 1ドル and 2ドル is `expr 1ドル + 2ドル`"



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Linux )

Latest Articles (in Linux)

(追記) (追記ここまで)
(追記) (追記ここまで)

Related Tutorials

AltStyle によって変換されたページ (->オリジナル) /