LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   My first alias in .bashrc...'apostrophes 'getting' in the way?' (https://www.linuxquestions.org/questions/linux-newbie-8/my-first-alias-in-bashrc-apostrophes-getting-in-the-way-194671/)

Baix 06-17-2004 02:16 PM

My first alias in .bashrc...'apostrophes 'getting' in the way?'
 
Hey guys first post :)

I've been trying to learn linux for a long time now and after a long break I'm finally having some successes :)

I'm trying to make an alias called 'share' for the command:
smbclient '\\CV943500-a\share$'

I added this to .bashrc and source'd it:
alias share='smbclient '\\CV943500-a\share$''

When I try to run it smbclient gives the error:
share: not enough '\' characters in service

Is smbclient not reading it right because of the double apostrophes? When I run the command normal it works fine. Thanks alot in advance :-D
(Note those are two single ( ' ) apostrophes not one double ( " )

Tinkster 06-17-2004 02:28 PM

Firstly, those should be slashes, not back-slashes.
Secondly, there's no need to wrap the service name
into quotes.
Try

alias share='smbclient //CV943500-a/share$'



Cheers,
Tink

Baix 06-17-2004 02:33 PM

Thanks! :) I wonder why it worked with backslashes when I just typed it. Anyway it works now, woot :cool:

Tinkster 06-17-2004 02:36 PM

Pleasure ;)


All times are GMT -5. The time now is 06:22 PM.