This may seem pretty trivial but I am a novice in bash scripting and I could not find the answer elsewhere.
I have mplayer installed on ubuntu 13.04 and I am using it to stream internet radio stations. Normally you need to provide the ip as argument for that:
mplayer http://176.31.113.37:8080
I have created an aliases file in root .bash_aliases
where I have the following:
export SOMA="http://173.239.76.147:8090"
export FRESH="http://176.31.113.37:8080"
Now I can play the radio using only the station name: mplayer $FRESH
.
I was wondering is it possible to get rid of the $
sign also to use the command mplayer FRESH
for example.
Thanks!
If you are using variables you need the $
to expand it. I would do this with aliases though, not variables. Consider something like this:
alias mpsoma='mplayer http://192.168.1.1:8090'
Then just type mpsoma
to run the full command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With