Skip to content

Instantly share code, notes, and snippets.

@skurhse
Last active March 28, 2021 23:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skurhse/3e865b2331e2c9faa7e21c03bac26d48 to your computer and use it in GitHub Desktop.
Save skurhse/3e865b2331e2c9faa7e21c03bac26d48 to your computer and use it in GitHub Desktop.
#!/bin/bash
env 1>&1 |
grep '^PATH=' 1> >(cat) |
cut -c 6- |
awk '
{
old = ":"
new = "\n"
while ($0 ~ /:/) {
idx = index($0, old)
$0 = substr($0, 1, idx-1) new substr($0, idx+length(old))
}
} 1
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment