Hi
I need some help with using shell script to analyze the content of a file. I hope someone can help me.
I have a file with content like the following:
/foldera/database/procedure/a.proc$$/version1/2
/folderb/database/procedure/proj1/b.proc$$/version2/2
I need to write a shell script to get the lines that contains ".proc" but I need to delete anything after .proc.
For example, for the above two lines, I need to get
/foldera/database/procedure/a.proc
/folderb/database/procedure/proj1/b.proc
So that I can go to each file and perform more analysis
when I do
grep ".proc" file.txt
I get the entire line including $$...
I am not sure how to remove the $$.. part
Hi All
I have just realized that beside removing anything after $$, I also need to remove anything before the file name.
That is, if my file has the following:
/foldera/database/procedure/a.proc$$/version1/2
/folderb/database/procedure/proj1/b.proc$$/version2/2
I hope to have the following result:
a.proc
b.proc
I have tried using unix "cut" command, but I am no where getting the result I wanted... could someone please give me some example...I am really stucked.
That's because the "." stands for any character and grep matches it to the slash that comes before proc (/proc). To match "." escape it so that it loses its special meaning...