![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl: Getting back reference from s modifier | cooldude | Shell Programming and Scripting | 8 | 03-19-2008 06:49 AM |
| What does this I/O error mean and how to mount it back | duke0001 | UNIX for Advanced & Expert Users | 5 | 03-19-2007 07:59 AM |
| C++ Compiling error.. Symbol Reference | bjena | UNIX for Advanced & Expert Users | 3 | 08-08-2006 11:10 PM |
| back-up drive : tape error | yackim | SCO | 3 | 03-03-2006 06:19 AM |
| Undefined reference to Error | svh | High Level Programming | 2 | 02-10-2006 09:23 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
back reference error
Hi,
i am getting this error........ find ./ | sed '/\([a-z]*\) \([a-z]*\)/\2\1/' Unrecognized command: /\([a-z]*\) \([a-z]*\)/\2\1/ Any idea??? regards Apoorva Kumar |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Yes, you aren't telling sed what command to execute! The regex is fine (haven't looked into the details), but sed needs to know what to do with the match if/when it finds it. i.e. If you want to just print the matching patterns, you still have to tell it to print them using the 'p' command.
Last edited by blowtorch; 08-22-2006 at 03:32 AM. |
|
#3
|
|||
|
|||
|
thanks partner!!..I just missed to put a s there.
I have few file in my dir..... abc 123 efg 567 I am trying this command..... for file in `find ./|sed 's/^/\"/'|sed 's/$/\"/'` do echo $file done This is the output i am getting......... "./" "./.sh_history" "./3rdPartytesting" "./abc 123" "" "./efg 456" "./bkup" The issue is there is an extra \n in the names of files which contains a space in them. Can you help me get a output like... "./" "./.sh_history" "./3rdPartytesting" "./abc 123" "" "./efg 456" "./bkup" regards Apoorva Kumar |
|
#4
|
|||
|
|||
|
Quote:
Please any anwers?? regards Apoorva Kumar |
|
#5
|
||||
|
||||
|
Pls don't bump-up posts if not answered immediately!
Code:
find . | sed 's/.*/"&"/' Last edited by vgersh99; 08-22-2006 at 07:39 AM. |
||||
| Google The UNIX and Linux Forums |