#!/bin/sh # make sure at least one parameter is passed in if [ "$1" = "" ] then echo ERROR: expect at least 2 numeric parameters exit 1 fi total=0 for number in $* do total=`expr $total + $number` done echo Total = $total
#!/bin/sh # make sure at least one parameter is passed in if [ "$1" = "" ] then echo ERROR: expect at least 2 numeric parameters exit 1 fi total=0 count=0 for number in $* do total=`expr $total + $number` count=`expr $count + 1` if [ $count -ne $# ] then echo -n "$number + " else echo -n "$number " fi done echo = $total
#!/bin/sh if [ $# -eq 0 ] then echo USAGE: $0 list_of_filenames echo $0 will return what type of files they are exit 1 fi for filename in $* do if [ -d $filename ] then type=directory elif [ -h $filename ] then type="symbolic link" elif [ -c $filename ] then type="character device file" elif [ -b $filename ] then type="block device file" elif [ -p $filename ] then type="named pipe" elif [ -f $filename ] then type="normal file" else type="something very unusual" fi echo $filename is a $type done
When you do you use CTRL-ALT-DELETE the script /etc/rc.d/rc.0 is executed. This would imply that it is executed by shutdown. This means that somewhere in shutdown /etc/rc.d/rc.0 should appear.
Try the command strings /sbin/shutdown Doing this the output reveals that there is no /etc/rc.d/rc.0.
However there is call to halt. Perhaps halt executes the script. Try strings /sbin/halt.
The two files necessay are
Located in each user's home directory and specifies accounts from specified machines which are considered equivalent to the local account even though they have different usernames.
I'll be using david as my username.
bilbo david panea backup
frodo root david backup arnold
bilbo david
frodo david
bilbo backup frodo backup
Any machine (e.g. gandalf) that wishes to be a trusted host of another (e.g. bilbo) i.e. the users want to be able to remote login. That machine (gandalf) must appear in the /etc/hosts.equiv file of the other (bilbo).
Also if a account on the first machine has a different username than the account on the second machine. Then a .rhosts file must exist in the home directory of the account on the second machine.
b) The main reason why this is not a good idea is security. The security mechanism associated with the Berkeley r commands is notoriously insecure.
David Jones (author)