How can I replace all semicolons after 1st one?@Masi, mikeserv's is portable, this one's shorter and more efficient with GNU sed. I'd go with mikeserv's unless you know your code or any copy of it will never end-up on a non-GNU system. Performance is probably not an issue unless your input is several megabytes