A repo of code snippets ..

...this is a log of code snippets and useful tips I wrote/found. Should you find any mistakes or have any useful suggestions, please do not hesitate to write to me.

Sunday, July 20, 2014

Replacing strings in a file

 perl -pi -e 's/pattern/patternToReplace/g' fileName.ext

for i in {2..200}; do
sed 's/xx/'$i'/g' template.m > select-$i.m
done
Posted by Neelima at 7:07 AM

No comments:

Post a Comment

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

Blog Archive

  • ►  2017 (7)
    • ►  June (3)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
  • ►  2016 (2)
    • ►  December (1)
    • ►  October (1)
  • ►  2015 (6)
    • ►  June (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ▼  2014 (21)
    • ►  September (2)
    • ►  August (5)
    • ▼  July (4)
      • some imp commands to be edited later..
      • Replacing strings in a file
      • Counting the files in all sub drectories of a folder
      • adding numbers is a bash script
    • ►  April (1)
    • ►  March (4)
    • ►  February (4)
    • ►  January (1)
  • ►  2013 (7)
    • ►  November (2)
    • ►  October (1)
    • ►  September (4)
  • ►  2012 (4)
    • ►  August (2)
    • ►  February (2)
Simple theme. Theme images by luoman. Powered by Blogger.