- Good program/shell script must interact with users. You can accomplish this as follows:
- Use command line arguments (args) to script when you want interaction i.e. pass command line args to script as :
$ ./sutil foo 4
where foo and 4 are command line args passed to shell script sutil.
- Use statement like echo and read to read input into variable from the prompt. http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/userinteuserinte,
- Even you can create menus to interact with user, first show menu option, then ask user to choose menu item, and take appropriate action according to selected menu item, this technique is show in following script;
http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/menuuimenuui.
2006-03-13