Can someone help and explain the last part of this project \"shuf\" the skeleton
ID: 3822481 • Letter: C
Question
Can someone help and explain the last part of this project "shuf" the skeleton is given need to finish it based on that ( read data from stdin)
103 Project 4 Reinventing Some Wheels Due: Friday, April 14th Recitation Synopsis In this project, you'll re-implement some standard unix utilities. In particular, you'll make clones (perhaps with some missing or different functionality) of wc, sort, uniq, shuf and tr. More about basic C++ data structures. Functions and arguments. A bit more about the unix shell.Explanation / Answer
Shuf is a command which is used in Unix(used in internet servers & workstations) and Linux(used in hardware & software,tablet pcs,game development) operating system for generating the random permutations from inputlines to standard output in which a file or series of files will shuffle(rearrange) the lines and write the result(outputs) to standard output.It should implement the options -e,-i,-n.
To shuffle the lines of file and print the output to standard output like 'shuf < /tmp/file.txt'.
It is a command line argument which included in the 'textutils package'.Shuf contains limit the no.of results which returns supporting the selecting random lines from a file or data from a list.
By using shuf command we can shuffle the lines in a file that used to pass a file,standard input or files to the command and result will be printed to standard output.((I just taking the example to understand)Ex: shuf cards.txt)
To pick a random line from a file using use '-n' option by using shuf command and it limits the output to the specified number (shuf -n 1 cards.txt) and to change the number select more than one line(shuf -n 4 cards.txt).
The '-e' option is used to shuffle the words passed to shuf in standard input and the shuffle items separated by spaces(shuf -e one two).shuf command also used along with Unix/Linux 'seq' or 'jot' command to perform the same as shuf "-i" option.