Welcome To Snipplr
Everyone's Recent Bash Snippets Tagged replace
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
Replaces string 'sth' with 'sth-new' in all files in current directory.
0
605
posted 11 years ago by ef
As portrayed by the example found in the [Advanced Bash Scripting guide](http://tldp.org/LDP/abs/html/here-docs.html) this demonstrates a few techniques
0
648
posted 11 years ago by symsec
As portrayed by the example found in the [Advanced Bash Scripting guide](http://tldp.org/LDP/abs/html/here-docs.html) this demonstrates a few techniques
0
627
posted 11 years ago by symsec
From the referenced website:
Well, that command speaks for itself "sed" edits "-i in place ( on the spot ) and replaces the word "ugly with "beautiful" in the file "/home/bruno/old-friends/sue.txt"
0
628
posted 13 years ago by bionic
From:
http://stackoverflow.com/questions/1169927/using-sed-and-grep-to-search-and-replace
0
590
posted 13 years ago by edeustace
Bash
Bash (Command Line): Loop through directories in specified location, replacing directories in current directory (with backup)
This command line aims at moving directories from a target location to the present working directory (pwd), backing the pwd directories up as it encounters them.
The script works by:
1. Iterating through the contents of the target directory (us...
0
718
posted 13 years ago by karlhorky
This snippet shows how to replace the colours in a monochrome image, i.e. one which only contains two colours and the range of hues between them.
0
528
posted 14 years ago by deepsoul
When you put an image in a printable document, you don't want it to have black (or coloured) background. ImageMagick allows to replace colours even when the coloured regions are non-contiguous. Arbitrary colour values can be specified with `\#12345...
0
511
posted 14 years ago by deepsoul
Replace all the occurrences of a string with a replacement in the supplied files.
2
744
posted 15 years ago by sanjivarunsahayamhotmailcom
\Q...\E perl quoting means no ugly escaping in the regex. find's -print0 with xargs -0 is the secret to handling files with spaces in their names.
1
905
posted 16 years ago by ches
Using this command makes it easy to do a project-wide search-and-replace
0
519
posted 17 years ago by collin
« Prev 1 Next »