View previous topic :: View next topic |
Author |
Message |
xmumblesx2k4 n00b
Joined: 28 Sep 2004 Posts: 7
|
Posted: Fri Oct 22, 2004 2:19 pm Post subject: Alias command causing hell |
|
|
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 |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Fri Oct 22, 2004 2:24 pm Post subject: |
|
|
I hope the missing "is just a typo? |
|
Back to top |
|
|
xmumblesx2k4 n00b
Joined: 28 Sep 2004 Posts: 7
|
Posted: Fri Oct 22, 2004 3:19 pm Post subject: |
|
|
yeah, the " is a typo, its just weird as the syntax of it looks fine... |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Fri Oct 22, 2004 3:22 pm Post subject: |
|
|
And if you use ' instead of " ? |
|
Back to top |
|
|
xmumblesx2k4 n00b
Joined: 28 Sep 2004 Posts: 7
|
Posted: Fri Oct 22, 2004 3:35 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
xmumblesx2k4 n00b
Joined: 28 Sep 2004 Posts: 7
|
Posted: Fri Oct 22, 2004 4:13 pm Post subject: |
|
|
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 , any way to possibly copy .bashrc from my normal user home directory to /root? |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Fri Oct 22, 2004 4:13 pm Post subject: |
|
|
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 |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Fri Oct 22, 2004 4:15 pm Post subject: |
|
|
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 |
|
|
xmumblesx2k4 n00b
Joined: 28 Sep 2004 Posts: 7
|
Posted: Fri Oct 22, 2004 4:56 pm Post subject: |
|
|
added this alias to root's .bashrc using the syntax you explained for the bash_profile file, and it worked like a charm! Thanks again for all your help BlackEdder, I'll remember that for future reference |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Fri Oct 22, 2004 5:02 pm Post subject: |
|
|
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 |
|
|
|