[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sed command spanning multiple lines



Is it possible to spread a sed command over multiple lines, to improve
readability (for the sake of future maintenance)?  If so, what
character is used to break the line and what are the rules?

For example, I would like to re-write the command:

sed -e 's/\.//g' -e 's/\,//g' -e 's/\\//g' "$1" | sort -u > foo

as:

sed -e 's/\.//g' 
-e 's/\,//g' 
-e 's/\\//g' "$1" 
| sort -u > foo

and be able to add additional lines such as:

-e 's/[0-9]//g'



Reply to: