1. The shell scripting questions. a) Sample directories /ds/test1/test2/test3/test4/test5 Create shell script a) if I pass as argument test1 then I will be under /ds/test1 b) if I pass as argument test2 then I will be under /ds/test2 so on.. 2) Create shell script to print output directories and files from root directories. They have provided some file format and according to that we need to print those. 3) Create shell script to remove duplicate lines from files. Example: file.txt /afg/ghkrad/akgh/ /akgh . . . so on .. contains almost 1000 above lines
Anoniem
1) First shell script, easy you can use arguments $0 and $1 and use if-else or switch case statement 2) You can use find command with -type f for file -type d for directories. Try to implement this on one command so that output will come as per Txt file they have provided. 3) Please use sort or unique command or awk command. Please remember when you solve this shell script, it will be Windows 7 machine 32 bit ! I was attended this test. At the first attempt I got error for backword compatible for architecture. Tell me how can I run 64 bit UNIX command those are .exe on Windows 7 32 bit operating system. When I asked them, this is what happened to me. They said right only logic . I have written a logic within 15 mins and left for the day. There is no one who can evaluate your efforts you kept on giving this aptitude test. I have taken a day leave , for this. Not good for me. Take a chance of yours you will have better luck!