Skip to content

Instantly share code, notes, and snippets.

@moalex
Created August 23, 2023 11:55
Show Gist options
  • Save moalex/5753b85f9d5e507383cf6aad52fba2b0 to your computer and use it in GitHub Desktop.
Save moalex/5753b85f9d5e507383cf6aad52fba2b0 to your computer and use it in GitHub Desktop.

sed command split

The sed command can also be used to split string data. The syntax for this command is:

sed 's/delimiter/\n/g'
sed 's/:/\n/g' <<< $PATH

In this case, g stands for global. It means that the substitution has to be globally, that is, for any occurrence. The example above shows how sed command is used to split string data using colon as a delimiter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment