I am getting error while passing a folder name that has space to the cmd line argument.
sh log_delete2.sh "/home/kumarpua/TESTARTIFACTS/atf-chix/ATF-subversion-dev/ssenglogs/A RM"
log_delete2.sh: line 17: cd: /home/kumarpua/TESTARTIFACTS/atf-chix/ATF-subversion-dev/ssenglogs/A: No such file or directory
expr: non-numeric argument
ls: /home/kumarpua/TESTARTIFACTS/atf-chix/ATF-subversion-dev/ssenglogs/A: No such file or directory
Can any one pls suggest how to ignore the space in folder name.....
I believe that this is a bug in log_delete2.sh. Very often bug: you should always use apostrophes: "string with spaces, $HOME"=1 argument that is parsed, '$HOME xxx'=1 argument that is not parsed, string xxx $HOME=3 arguments that are parsed.
Most of the scripts I have seen have problems with such names/params
Do not try to pass directories like '/home/user/ directory with space as first character' - such scripts tends to do:
rm -rf $param
so it runs as
rm -rf /home/user
rm -rf directory
rm -rf with
rm -rf space
rm -rf as
rm -rf first
rm -rf character