LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 01-22-2009, 05:41 AM   #1
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Rep: Reputation: Disabled
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.
 
Old 01-22-2009, 05:54 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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.
 
Old 01-22-2009, 06:38 AM   #3
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,051

Rep: Reputation: 170Reputation: 170
Why not use an underscore? ftp_openbsd

cheers,
 
Old 01-22-2009, 06:41 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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?
 
Old 01-22-2009, 10:13 AM   #5
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by noir911 View Post
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.

Last edited by rweaver; 01-22-2009 at 10:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how many lines and words (bash) sharapchi Programming 4 12-15-2006 01:45 PM
bash : remove replicator words?, how? Guru Mind Programming 13 05-18-2006 01:24 AM
BASH: First words in a line JordanH Programming 7 10-24-2004 11:00 AM
alias two words or more chii-chan Linux - Newbie 5 05-31-2004 03:00 AM
Giving multiple words as argument for bash ivanatora Linux - General 5 01-07-2004 03:04 AM


All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration