how to find out *.sh file name in a text file
hi all
I have a text file which contains name of files, I want to remove *.sh files from that list. what is solution ? thanks MKSC |
Code:
egrep -v "*\.sh$" inputfile > outputfile |
Quote:
its not working. I explain you my problem. let i have a file abc.txt it contains hjhj.sh jhdj.txt skf.pdf jks.dat jk.shd vsh.txt sh.ro I want to create another file which contains jhdj.txt skf.pdf jks.dat jk.shd vsh.txt sh.ro Now what is solution of this? Thanks MKSC |
It works for me:
Code:
pwc101@example_win ~ $ cat abc.txt Code:
grep -v -E "*\.sh$" abc.txt > def.txt grep -E and egrep are synonymous. I tested this on RedHat: Code:
pwc101@example ~$ grep --version; echo; cat /etc/redhat-release; echo; bash --version Code:
pwc101@example_win ~ $ grep --version; echo; bash --version |
hi
I did like this cat "$filePath" | grep "\b.sh\b" and its working fine. thanks & Regards MKSC |
All times are GMT -5. The time now is 05:04 AM. |