shell-base/modules/scripting/comment.lob

11 lines
264 B
Plaintext
Raw Normal View History

#!/bin/bash
function comment() {
[[ $# -lt 2 ]] && echo must supply pattern and file && return 1
sed -i '/'$1'/s/^#*/#/g' "$2"
}
function uncomment() {
[[ $# -lt 2 ]] && echo must supply pattern and file && return 1
sed -i '/'$1'/s/^#*//g' "$2"
}