Created
October 25, 2013 16:40
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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