Need help Thank you The following shell script is used to pr

Need help. Thank you.
The following shell script is used to process files in directory test which is located in current working directory. It has following features: Add a prefix \"my\" to all c files in directory test. E g. Rename test.c as mytest.c Add an extension \".bak\" to all txt files in directory test. E g Rename test as test.txt as test.txt.bak compile all java files in directory test Count the number of c files in directory test #1/bin/bash nCfile = 0 for dir in; do case \"$dir\" in *.c)n n;; *.txt);; esac done echo there are $ncfile c files in directory test

Solution

Shell Script to all requirmnets given

for i in *.c ;do mv $i my$i; done //rename all c files in current test folder into with prefix my

for i in *.txt ;do mv $i $i.bak; done   //rename all c files in current test folder into with extension .bak

ls -lR ./*.c | wc -l //counts and dispalys number of c files in current folder

Need help. Thank you. The following shell script is used to process files in directory test which is located in current working directory. It has following feat

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site