Skip to content

Instantly share code, notes, and snippets.

@Khalian
Created August 6, 2017 07:51
Show Gist options
  • Save Khalian/e70c621ad5de3d9af7230f6043cbaa3e to your computer and use it in GitHub Desktop.
Save Khalian/e70c621ad5de3d9af7230f6043cbaa3e to your computer and use it in GitHub Desktop.
Remove all characters after a given character.
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: remcharafter character"
exit 1
fi
cut -f1 -d"$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment