Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alias command causing hell
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
xmumblesx2k4
n00b
n00b


Joined: 28 Sep 2004
Posts: 7

PostPosted: Fri Oct 22, 2004 2:19 pm    Post subject: Alias command causing hell Reply with quote

Hey

Everything so far on my gentoo system is workin' great, just whenever I try to input an alias for mounting a windows share, it spits me back out to a prompt that looks like ">" which I can't do anything with

I type: alias downloads="mount -t smbfs //pentiumPC/Downloads /mnt/downloads -o username=username,password=password

but whenever I do that I just get taken back to an weird looking ">" prompt that I can do nothing at (the command obviously didn't work)

I'll post the output of .bashrc if anyone needs it :) any help would be appreciated on how to get this workin' again :)
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Fri Oct 22, 2004 2:24 pm    Post subject: Reply with quote

I hope the missing "is just a typo?
Back to top
View user's profile Send private message
xmumblesx2k4
n00b
n00b


Joined: 28 Sep 2004
Posts: 7

PostPosted: Fri Oct 22, 2004 3:19 pm    Post subject: Reply with quote

yeah, the " is a typo, its just weird as the syntax of it looks fine... 8O
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Fri Oct 22, 2004 3:22 pm    Post subject: Reply with quote

And if you use ' instead of " ?
Back to top
View user's profile Send private message
xmumblesx2k4
n00b
n00b


Joined: 28 Sep 2004
Posts: 7

PostPosted: Fri Oct 22, 2004 3:35 pm    Post subject: Reply with quote

ok, with a ' instead of " it seems to go through, but whenever I run the command "downloads" (no quotes) it just gives a command not found error :?:

I appologize for soundin' like a n00b, thanks for the help so far 8)
Back to top
View user's profile Send private message
xmumblesx2k4
n00b
n00b


Joined: 28 Sep 2004
Posts: 7

PostPosted: Fri Oct 22, 2004 4:13 pm    Post subject: Reply with quote

ok, I got the alias command to show up without a problem, but now when I type alias into the konsole as a normal user, I see the alias I made before, but when I go to run the comand "downloads" (no quotes) it says mount: only root can do that. So I su to root and try to run it but it says command not found

Interesting thing is I'm assuming I need to input this alias command into the .bashrc file of root's home directory /root but when I do ls -a in /root there's only ".bash_history" and no .bashrc 8O , any way to possibly copy .bashrc from my normal user home directory to /root?
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Fri Oct 22, 2004 4:13 pm    Post subject: Reply with quote

Are you trying this as a user or as root?
If as a user use smbmount instead of mount -t smbfs (rest of the command the same)
As root it should work, I guess you already tried if the command works when you don't have it as an alias
If you type alias with no options it should list the alias in usage. Is downloads listed?
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Fri Oct 22, 2004 4:15 pm    Post subject: Reply with quote

You can create a .bashrc in /root, but it won't be used unless you also make a .bash_profile with:
[ -f ~/.bashrc ] && . ~/.bashrc
To mount a samba share as user use smbmount like I explained before
Back to top
View user's profile Send private message
xmumblesx2k4
n00b
n00b


Joined: 28 Sep 2004
Posts: 7

PostPosted: Fri Oct 22, 2004 4:56 pm    Post subject: Reply with quote

added this alias to root's .bashrc using the syntax you explained for the bash_profile file, and it worked like a charm! :D Thanks again for all your help BlackEdder, I'll remember that for future reference
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Fri Oct 22, 2004 5:02 pm    Post subject: Reply with quote

BTW the reason for using ' instead of " has to do with regular expressions. A sentence between "" will be checked for regular expressions (and I think / are used for regular expressions) while a sentence between ' will be seen as a string. Therefore you're better of using ' just to be on the safe side

NOTE: I'm not 100% sure about all this, so if someone knows the real reason plz enlighten me :))
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum