Skip to content

Instantly share code, notes, and snippets.

@felix-orduz
Created January 11, 2016 22:52
Show Gist options
  • Select an option

  • Save felix-orduz/6eb13883442b00547cee to your computer and use it in GitHub Desktop.

Select an option

Save felix-orduz/6eb13883442b00547cee to your computer and use it in GitHub Desktop.
Split a string without ‘cut’ or ‘awk’
#!/bin/bash
line=’this “is” a command;this “is” a pattern’
COMMAND=${line%;*}
PATTERN=${line#*;}
echo $COMMAND
echo $PATTERN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment