User Tools

Site Tools


opus:fall2012:kpryslop:unixpart3

unix Keyword 3

dd

Definition

Convert and copy a file.

References

unixhelp.ed.ac.uk/CGI/man-cgi?dd

unix Keyword 3 Phase 2

Comm

Definition

“comm” is a UNIX command which can be used to compare two sorted files. The input for comm is two files, and the output is two separate columns. The command syntax for comm is

comm [OPTION]... FILE1 FILE2

comm has three main options, -1, -2, and -3.

The -1 option will print the lines present in FILE1 in the left hand column, and all common lines in the right hand column, whereas the -2 option will do the opposite (print lines present in FILE2 on the left, and common lines on the right). The -3 option, however, will only print lines unique to both files, with FILE1's unique lines being on the left, and FILE2's unique lines on the right.

References

  • man comm!
lab46:~/src/unix$ comm -3 blah test 
#script 3
comm: file 1 is not in sorted order
#
	echo -n "enter a number: "
	read number
comm: file 2 is not in sorted order
	echo -n "How many times: "
	read times  
	for((i=$number; i<$times; i**)); do
	    let x=i*i
	    echo "[$i] $x"
	done
value=`$RANDOM`
echo $value
echo -n "Guess a value: "
read num
if [ $num -eq $value ]; then
	echo "You are correct"
elif [ $num -gt $value ]; then
	echo "Too high"
else
	echo "Too low"
fi
opus/fall2012/kpryslop/unixpart3.txt · Last modified: 2012/11/30 15:16 by kpryslop