I'm using a bash shell and I want to make an alias that will do a couple things to a given directory. Let's say I want the alias to be "execute" and I want it to ls and cd. I want "execute" to take a single argument, which is a directory that it will then ls, and then cd into.
execute temp
should be the equivalent of:
ls temp ; cd temp
So how can I create an alias for execute that reads the next input after execute, and then use that as an argument for the other two? Something like this?
alias execute="directory=VALUE ; ls $directory ; cd $directory"
alias tstR='doSomething '(note the trailing space) which will set up the cmd line with what ever you type aftertstR. Read about shell functions, they are designed to process arguments. Good luck.