yes all the time i am looking into the third field. yes my output is usually like this
test=A /content/qa/lesson1/index.html A /content/qa/lesson2/index.html
I am checking the svn repository if there has been new index.html file added. There could be as many index.html file but the folder name is different. currently in the example I have two files. based on that I need to create a redirect file that points to that location on a server. So I need that folder name to create that url.
So what i am doing here is checking to see if new index.html file has been added to the repository. and then from there i am need to extract the folder name.
>>>A /content/qa/lession1/index.html A /content/qa/lession2/index.html
thanks.
---------- Post updated at 05:14 PM ---------- Previous update was at 04:43 PM ----------
One thing I also realised that gawk '{print $2"\n"$4}' works only if you have two files. if it is more than 2 then index. If there are three files checked in to the repository it will still return only 2 files.
$ echo test=A /content/qa/lesson1/index.html A /content/qa/lesson2/index.html A /content/qa/lesson3/index.html| gawk '{print $2"\n"$4}'
/content/qa/lesson1/index.html
/content/qa/lesson2/index.html
Can you just enter the command?
The way you have it, you are writing output from the command to a string and then writing that to a file. Thus, why do you need to write the >>> ?
Do this
Sorry, yes I write the output to a text file $ACTION_LOG and i do
tail -f when I actually check in files through my IDE to see if anything is coming out.
echo test=A /content/qa/lesson1/index.html A /content/qa/lesson2/index.html A /content/qa/lesson3/index.html | \
sed 's/A/~A/g' | tr '~' '\n' | grep "^A" | cut -d" " -f2 | cut -d"/" -f4
I get
lession1
lession2
lessions
Now I need to plug this into my actual code and see if that works as i wanted. THanks for helping me so far. i will inform you if i got this going. thanks.