Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SED, Trailing "/" to each line 1

Status
Not open for further replies.

AIXtexas

Technical User
Feb 5, 2002
80
US
Below is my output:

ibm03:/home/root (1038)#find /ibm03usr1 -name _HOLD_* -type d
/ibm03usr1/ud/fastcs/_HOLD_
/ibm03usr1/ud/fast.practice/_HOLD_
/ibm03usr1/ud/demo/demo/_HOLD_
/ibm03usr1/ud/demo/_HOLD_
/ibm03usr1/ud/bin/demo/_HOLD_

I would like the output to be:

ibm03:/home/root (1038)#find /ibm03usr1 -name _HOLD_* -type d
/ibm03usr1/ud/fastcs/_HOLD_/
/ibm03usr1/ud/fast.practice/_HOLD_/
/ibm03usr1/ud/demo/demo/_HOLD_/
/ibm03usr1/ud/demo/_HOLD_/
/ibm03usr1/ud/bin/demo/_HOLD_/

In othere words, I need to add a trailing "/" to the last line of each entry. I'm certain this can be done with SED, I just cant figure it out.

Thanks,
Shane

 
find /ibm03usr1 -name _HOLD_* -type d | sed 's!$!/!'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Feherke, this dosent work?

ibm03:/home/root (1000)#find /ibm03usr1 -name _HOLD_* -type d -printf "%p/\n"
find: bad option -printf

Shane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top