RosettaCodeData/Task/Strip-comments-from-a-string/Sed/strip-comments-from-a-strin...

4 lines
76 B
Sed

#!/bin/sh
# Strip comments
echo "$1" | sed 's/ *[#;].*$//g' | sed 's/^ *//'