(2) 2. When using ftp, how do you list files in your local directory?
(1) lls (2) !ls (3) lcd (4) !cd
(4) 3. If a script is run as foo -l -t bar[1-4], what is the value
of $#?
(1) 3 (2) 4 (3) 5 (4) 6
(1) 4. Which one is the here document?
(1) << (2) >> (3) <1 (4) >1
(3) 5. To debug shell script, what is put into the beginning of the script?
(1) set -dg (2) set -u
(3) set -x (4) set -w
Ans: 1) A domain name locates an organization or other entity on the Internet.
2) www.cs.twsu.edu is a domain name.
Ans: 1) A port number is a number which is used to identify a TCP/IP service.
Daemons listen for requests at certain specific port numbers assigned
to them.
2) Know port numbers are defined in /etc/services.
3) sendmail listens on port 25, ftp on 21 and telnet on 23.
Ans: 1) Use put or mput to upload. Use get or mget to download.
2) Set ascii mode to transfer a text file and set binary mode to
transfer an image file.
Ans: If a script is invoked without any argument, $1 would be null and
filename would be set to emp.lst.
Ans: #!/bin/sh
n=$1
sum=$1
while [ $n -gt 1 ]
do
n=`expr $n - 1`
sum=`expr $sum + $n`
done
echo "Sum = $sum."