Skip to content

Instantly share code, notes, and snippets.

@felix-orduz
Created October 25, 2013 16:40
Show Gist options
  • Select an option

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

Select an option

Save felix-orduz/7157720 to your computer and use it in GitHub Desktop.
"split" de una cadena sin necesidad de cat ni otro programa salida: this “is” a command this “is” a pattern Fuente: http://antonolsen.com/2006/04/10/bash-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