Maybe something like this:
sed 's/ab/~~/g; s/bc/ab/g; s/~~/bc/g'
from : https://stackoverflow.com/questions/26568952/how-to-replace-multiple-patterns-at-once-with-sed
Maybe something like this:
sed 's/ab/~~/g; s/bc/ab/g; s/~~/bc/g'
from : https://stackoverflow.com/questions/26568952/how-to-replace-multiple-patterns-at-once-with-sed
cat $PROPERTY_FILE | grep "$PROP_KEY" | cut -d'=' -f2$ VAR="Banana";$ VAR=${VAR#?};$ echo $VAR;ananaIn cross-platform, lowest-common-denominator sh you use:
#!/bin/sh
value=`cat config.txt`
echo "$value"In bash or zsh, to read a whole file into a variable without invoking cat:
#!/bin/bash
value=$(<config.txt)
echo "$value"while read -r num; do ((sum += num)); done < inputfile; echo $sum
if grep -q SomeString "$File"; then
Some Actions # SomeString was found
fiIn case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...