comment next line after line starting with root string
sed '/^root/ { n; s/^/#/ }' /etc/passwd
comment line 2 after line starting with root string
sed '/^root/ { n;n; s/^/#/ }' /etc/passwd
comment next line after line starting with root string
sed '/^root/ { n; s/^/#/ }' /etc/passwd
comment line 2 after line starting with root string
sed '/^root/ { n;n; s/^/#/ }' /etc/passwd
comment line starting with string and the next
sed '/^mail/,+1s/^/#/' /etc/passwd
comment line starting with string and the next 3 lines
sed '/^mail/,+3s/^/#/' /etc/passwd
if [[ $( awk '$1 > $2' <<<"77.999 77.998" ) ]]; then
echo first number is bigger than second
fi
test $# -eq 0 && echo usage: $0 file && exit
tmp_file=/tmp/tmp.$( basename $1 )
cp $1 $tmp_file
sed 1d $tmp_file |
sort -k1 |
cat <( head -1 $tmp_file ) - > $1
rm -f $tmp_file