Created
April 10, 2018 08:54
-
-
Save alanxoc3/fc135e33fde1fbad26b1defd849d15a5 to your computer and use it in GitHub Desktop.
A simple script that opens up xterm with a command or an alias!!!
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
#!/bin/bash | |
# For running commands on xterm startup. | |
# The newline is needed, because bash does weird things with aliases. Bash | |
# needs a line before the shopt command takes effect. That was a wild goose | |
# chase! | |
# http://www.delorie.com/gnu/docs/bash/bashref_72.html | |
xtermcmd() { | |
xterm -e "bash --rcfile <(echo -e \"shopt -s expand_aliases; . ~/.bashrc;\n$*\")" | |
} | |
xtermcmd "$*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks simple, but it was a pain. Partly because of xterm and partly because of weird quirks with bash and aliases. But it works now! You can supply your alias to this simple script and it will run your alias in a terminal! Yahoo!