Unix Shell - sed backreference question

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > February 2005 > sed backreference question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author sed backreference question
Braveheart

2005-02-24, 5:58 pm

Hello,


I would like to execute a command from within sed (in a Bourne shell
script), similar to the following (this is just an example of what I
want to do):


echo $LIST | head -30 | sed "s/\(.*\)~\(.*\)~\(.*\)/`ls \2`/"


This doesn't work because the backreference does not get expanded when
`ls \2` is executed. Is there any way to accomplish this?


Thanks!

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com