Quantcast
Channel: Michael Paquier » linux
Viewing all articles
Browse latest Browse all 12

Script to replace string with sed

$
0
0
Here is a short script to replace strings with sed easily written in bash. #!/bin/bash #Replace string in file of given extension #argument 1, extension type #argument 2, old string #argument 3, new string EXPECTED_ARGS=3   if [ $# -ne $EXPECTED_ARGS ] then   echo "Usage: `basename $0` [extension] [old_str] [new_str]"   echo "Exemple: `basename $0` php [...]

Viewing all articles
Browse latest Browse all 12

Trending Articles