#! /bin/sh # ############################################################################### # Shell script to run display iTOUGH2 manual pages (Finsterle, January 1997) # # # # Copy this file to your $HOME/bin directory. # # Set variable help_dir (line 23). # # Make sure that directory $HOME/bin is in your search path. # # Type "chmod a+x it2help" to make it2help an executable command. # # # # Syntax: it2help command [command_level] # # # # command : iTOUGH2 command # # command_level: command level (1, 2, 3, or 4) # # # # Example: it2help 3 iteration # # Type "it2help index" to obtain the iTOUGH2 command index # # Type "it2help update" to obtain information on recent iTOUGH2 updates # ############################################################################### # ############################################################################### # Provide here the path to the iTOUGH2 help file it2help.txt # help_dir=/home/finster/itough2/SpecialFiles ############################################################################### # # Print command index # cmd=`echo $1 | tr [a-z] [A-Z]` cml="(all levels)" if test "$2" = 1 then cml=">" fi if test "$2" = 2 then cml=">>" fi if test "$2" = 3 then cml=">>>" fi if test "$2" = 4 then cml=">>>>" fi if test "$cmd" = "INDEX" -a "$cml" = "(all levels)" then sed -n "/^> COMMAND INDEX/,/^@@@/p" $help_dir/it2help.txt | more echo " " exit fi if test "$cmd" = "UPDATE" then sed -n "/^> VERSION UPDATE/,/^@@@/p" $help_dir/it2help.txt | more echo " " exit fi if test "$cmd" = "LOGBOOK" then cat $HOME/itough2/itough2.log echo " " exit fi # # Print manual pages # if test $# -lt 1 then echo " " echo " ===================================================================" echo " IT2HELP --- IT2HELP --- IT2HELP --- IT2HELP --- IT2HELP --- IT2HELP" echo " ===================================================================" echo " " echo " Purpose:" echo " " echo " Displays iTOUGH2 manual pages online." echo " " echo " Syntax:" echo " " echo " it2help command [command_level]" echo " " echo " command = iTOUGH2 command" echo " command_level = integer indicating command level (1, 2, 3, or 4)" echo " " echo " Examples:" echo " " echo " 1. it2help iteration" echo " Prints manual pages of command ITERATION on all command levels." echo " " echo " 2. it2help iteration 3" echo ' Prints manual page of third-level command >>> ITERATION.' echo " " echo " 3. it2help index" echo " Prints the iTOUGH2 command index." echo " " echo " 4. it2help update" echo " Prints version update information." echo " " echo " 5. it2help logbook" echo " Prints iTOUGH2 logbook entries." echo " " echo " ===================================================================" echo " " exit 1 fi echo " " echo "======================================================================" echo "Manual page for iTOUGH2 command: $cml $cmd" echo "======================================================================" echo " " if test "$2" = "" then for i in ">" ">>" ">>>" ">>>>" do com="Syntax: "$i" "$cmd sed -n "/^$com/,/^@@@/p" $help_dir/it2help.txt >> help_tmp done else com="Syntax: "$cml" "$cmd sed -n "/^$com/,/^@@@/p" $help_dir/it2help.txt > help_tmp fi if test ! -s help_tmp then echo "No manual page found for iTOUGH2 command $cml $cmd" else echo " " cat help_tmp | more fi rm help_tmp echo " "