How do you test for file properties in shell scripts?
Answer / chaitanya
-s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability
| Is This Answer Correct ? | 1 Yes | 0 No |
How do you stop all the processes, except the shell window?
How do you remove recursively?
What’s the command to find out users on the system?
How do you list currently running process?
What are PIDs?
What’s a way to do multilevel if-else’s in shell scripting?
How does a case statement look in shell scripts?
How do you test for file properties in shell scripts?
How do you fire a process in the background?
How do you remove a file?
i have some csv files in a directory which have sub-directories also. now how can i merge all .csv files in to one with a single header. for example: have some 4 files. 1.csv--------name,age,sal abc,25,4000 2.csv--------name,age,sal vgd,32,3500 3.csv--------name,age,sal hfg,20,5000 4.csv--------name,age,sal asd,15,2000 now my output file should be like 5.csv----------name,age,sal abc,25,4000 vgd,32,3500 hfg,20,5000 asd,15,2000 and please explain the code for me. as i am new to scripting. thank you in advance
How do you find out the current directory you’re in?