Thilina's Blogger

Thursday, May 24, 2007

Usefull Shell commands

Replacing a parameter

x=/home/beyondm/account
src="/"
dis="\/"
result=`echo $x | sed s\}$src\}$dis\}\g`

echo $result will result
/home/beyondm/account
Posted by Unknown at 11:26 PM

1 comment:

Unknown said...

Appending a text (say "Once upon a tim") to each line of the file (eg: y.txt)


sed -i 's/\(.*\)/Once upon a tim \1/g' y.txt

May 29, 2007 at 10:33 PM

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Unknown
View my complete profile

Total Pageviews

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Blog Archive

  • ►  2015 (1)
    • ►  November (1)
  • ►  2014 (1)
    • ►  November (1)
  • ►  2012 (1)
    • ►  April (1)
  • ►  2011 (2)
    • ►  July (2)
  • ►  2010 (9)
    • ►  September (1)
    • ►  July (1)
    • ►  April (1)
    • ►  March (3)
    • ►  February (1)
    • ►  January (2)
  • ►  2009 (7)
    • ►  December (1)
    • ►  October (3)
    • ►  February (1)
    • ►  January (2)
  • ►  2008 (8)
    • ►  July (2)
    • ►  June (1)
    • ►  May (4)
    • ►  February (1)
  • ▼  2007 (17)
    • ►  November (1)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (4)
    • ►  June (3)
    • ▼  May (4)
      • Usefull Shell commands
      • Exciting Open Source ETL - Pentaho Data Integratio...
      • Important MySQL commands
      • Did you ever encounter a java.lang.OutOfMemoryErro...
Copyright © 2011 Thilina Anjitha. All rights reserved. Simple theme. Powered by Blogger.