Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

you can add a function to your bashrc

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

then if you run

webdo <command> <args>

will run

command args http://www......
share|improve this answer

You could do

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

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.