@jack_9: the examples I've given in my previous 2 posts are for literal "\t" - particularly the sed example (you can convert the 4 spaces (before the /g) to whatever else you'd like to be in there).
|
Yeah I am still not with you :(
Using your example: If we assume that the following returns "1 2 3 4 adlkjlfd;%114 \ttow\p felk&\t*" Code:
rec=`sed -n "$j{p;q;}" ${file}` Code:
grep -x "${rec//\\/\\\\}" ${file}_dup |
Dunno :( Its not working.....
$ grep -x "${rec//\\/\\\\}" rec1 $ echo $? 1 $ echo "${rec//\\/\\\\}" 1 2 3 4 adlkjlfd;%114 \\ttow\\p felk&\\t* $ echo $rec 1 2 3 4 adlkjlfd;%114 \ttow\p felk&\t* $ cat rec1 1 2 3 4 adlkjlfd;%114 \ttow\p felk&\t* $ |
hmmm ... seems your -x on grep is putting you between a rock and a hard place. I think it is interpreting the \\ to be 2 slashes but when left as a single it thinks of \t
as a tab. I would add that without -x it works just fine. |
Yeah Grail.. you are correct.. the grep(in my unix box) is really poor..
And I did not find any other option except "-x" because I need to match the entire line.. If I wont give "-x" then, the half of line will also match, which wont give me the right result or pattern matching... I think you understood my point.. |
You could put start and end, ie ^$, around the string but you actually have another issue to. It appears that the current solution also has an issue that the final asterisk is not
matched unless escaped. I must say I would wonder who in their right mind would have a database filled with this gibberish?? |
Yeah, grail.. u r correct..
Finger crossed :) Sybase database is also not very reliable in joins for such values(Like Space) So, I wanted my script, should work on file level instead of database level..but in file level also I'm facing this issue.. I was happy with my Linux box and lots of options for grep and was able to do many stuffs.. However this unix box(and Sybase) is not allowing me to free up.. :( |
All times are GMT -5. The time now is 11:38 PM. |