Created
March 13, 2012 17:03
-
-
Save jubianchi/2029937 to your computer and use it in GitHub Desktop.
This file contains 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
## Lancez cette commande dans un tertminal | |
cat <<EOT | sudo tee /usr/local/bin/which_sf && sudo chmod +x /usr/local/bin/which_sf | |
#!/bin/sh | |
./symfony | perl -ne 'if( /^([a-zA-Z0-9\-]+)/ ) { \$first = \$1; } elsif ( /^\s*(:[a-zA-Z0-9\-]+)/ ) { print \$first . \$1 . "\n"; }' | grep \$1 | |
EOT | |
## | |
##Usage : | |
which_sf foo | |
>>> foo:bar | |
>>> bar:foo | |
which_sf foo: | |
>>> foo:bar | |
./symfony "$(which_sf foo)" | |
>>> Lance la commande correspondant à la recherche si UN SEUL résultat est retourné (sinon, ERREUR ! :|) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment