Hi,
I want to list all the files matching in a directory directory given below
Here one of the folder has a space in the path.
/MAS02/RMS/WBDev/Krishna/Krishna Mohan/FMSplitByKeyAfterChanges1000075383.fileman.*.txt.out.1000075383.0
The following works from command line
********************************
ls '/MAS02/RMS/WBDev/Krishna/Krishna Mohan/'FMSplitByKeyAfterChanges1000075383.fileman.*.txt.out.1000075383.0
I am trying to do the same stuff from shell script ,but it is not working.
Pls suggest
********
#!/bin/ksh -x
#
in="/MAS02/RMS/WBDev/Krishna/Krishna Mohan/FMSplitByKeyAfterChanges1000075383.fileman.*.txt.out.1000075383.0"
dirName=`dirname "$in"`
fileName=`basename "$in"`
newfileslist=\'$dirName/\'$fileName
filecnt=`ls $newfileslist | wc -l `
It gives an error like this, when I execute above script
****************************************
+ ls /MAS02/RMS/WBDev/Krishna/Krishna Mohan/FMSplitByKeyAfterChanges1000075383.fileman..txt.out.1000075383.0
+ wc -l
ls: /MAS02/RMS/WBDev/Krishna/Krishna: No such file or directory
ls: Mohan/FMSplitByKeyAfterChanges1000075383.fileman..txt.out.1000075383.0: No such file or directory
+ fcnt=0