0

I have a server called someserver and a website called mylongwebsiteaddress.com.

Basically I always type $./somecommand.sh someserver.mylongwebsiteaddress.com in cygwin when doing updates to servers.

Is there a way to make an alias so that I can type somecommand.sh someserver.MY and it will fill in the mylongwebsiteaddress for me at the end of the line and then let me press enter to run the command?

Very noob here, so let me know if that's not clear enough.

3 Answers 3

2

you can add a function to your bashrc

webdo(){
    $@ http://www......
}

then if you run

webdo <command> <args>

will run

command args http://www......
1

If you put the hostname in $HOSTFILE (/etc/hosts by default), you can use Meta@ to do a completion on the name.

0

You could do

 export MY=mylongwebsiteaddress.com 
 somecommand.sh someserver.$MY

(note the use of $MY instead of just MY).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .