LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   bash alias - two words (http://www.linuxquestions.org/questions/linux-general-1/bash-alias-two-words-699080/)

noir911 01-22-2009 04:41 AM

bash alias - two words
 
Is there any way to get bash alias with more than one word? I would like to have alias ftp openbsd = 'ftp://ftp.openbsd.org' but it gives an error.

acid_kewpie 01-22-2009 04:54 AM

no, it's not as the second word would be seen as a parameter by bash. So even if you could set it, you couldn't use it.

mrclisdue 01-22-2009 05:38 AM

Why not use an underscore? ftp_openbsd

cheers,

acid_kewpie 01-22-2009 05:41 AM

too obvious? additionally the syntax in the alias is totally wrong with the whitespace there and that's not even what an alias is for. a url is not a valid bash command, how is it meant to be useful?

rweaver 01-22-2009 09:13 AM

Quote:

Originally Posted by noir911 (Post 3417148)
Is there any way to get bash alias with more than one word? I would like to have alias ftp openbsd = 'ftp://ftp.openbsd.org' but it gives an error.

Even under the assumption that you could alias two words (which you can't), syntax is right, etc... that wouldn't do anything.

You're basically just sending a url at the command prompt, bash isn't in the business of dealing with urls.


All times are GMT -5. The time now is 05:56 PM.