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

4 lines
76 B
Sed
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
#!/bin/sh
# Strip comments
echo "$1" | sed 's/ *[#;].*$//g' | sed 's/^ *//'