I need an edit made to the following shell script.
(
cd $SRC
find ./ -type f | while read FILE;do
# Build Destination path
DEST_FILE=$DST/${FILE#./}
callLib [login to view URL] $FILE $DEST_FILE
done
)
if file is a javascript file (.js) then execute the PERL below and copy the resultant file instead of the orginal to the $DEST_FILE location
perl -n -e 's/^\s*\/\/.*$//; s/^\s+//; print if /\S/'
Should be do-able in a day.
How are we going to determine if the file is a javascript file? Will a simple string extension check suffice? Or do we need to do content detection? Also, will there be any files without an extension? Are there filenames with spaces in them? Looking forward to hear from you.
Hello,
I think here you are finding all the files in the current directory and reading the content of the file. and you are getting the dstination file name with some junk spaces, that you want to remove using the perl statement. I can do this easily. If i am wrong please correct me and ping me to have a detailed discusssion about the requirement.