Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Anführungsstriche in der Bash
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2146
Location: Europe

PostPosted: Thu Jul 29, 2004 3:32 pm    Post subject: Anführungsstriche in der Bash Reply with quote

Moin,

ich will ein Samba-share-Verzeichnis mounten und im bash-kommando das Passwort angeben. Leider hat das Passwort ein Anführungszeichen, sodass die Bash denkt, dass das geschlossen werden muss.
Auch wenn ich einen backslash davor mache, will sie es nicht.

Wie kann ich das umgehen?


Tschö mit ö
Manuel
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Thu Jul 29, 2004 3:39 pm    Post subject: Reply with quote

versuchs mal mit
Code:

smbmount -o credentials=/pfad/datei

cat /pfad/datei
Code:

username=bla
password=bla"bla
Back to top
View user's profile Send private message
EliasP
Guru
Guru


Joined: 06 Dec 2002
Posts: 318
Location: South-West Germany

PostPosted: Thu Jul 29, 2004 4:09 pm    Post subject: Reply with quote

Du solltest das Anführungszeichen einfach escapen, also z.B. so
password="pass\"word"

Gruß

Elias P.
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2146
Location: Europe

PostPosted: Thu Jul 29, 2004 5:28 pm    Post subject: Reply with quote

hey, das klappt super, aber folgendes klappt in der /etc/fstab nicht:

Code:
//192.168.6.200/mld_inc /mnt/mld_inc    smbfs           username=myusername,password="***\"***",user        0 0                                                                                                                                                 
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Thu Jul 29, 2004 6:05 pm    Post subject: Reply with quote

also für fstab würde ich eh credentials vorschlagen, weil die standartmässig jeder lesen kann. und damit auch das passwort.
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2146
Location: Europe

PostPosted: Thu Jul 29, 2004 6:46 pm    Post subject: Reply with quote

da hast du auch wieder recht. also hab ich das jetzt mal so gemacht. aber das mounten geht nur als root. wieso?

Code:

# ls -l /mnt/
drwxrwxr-x  2 root users 48 Mar 21 19:22 mld_inc

# mount /mnt/mld_inc/
timeout connecting to 192.168.6.200:445
cannot mount on /mnt/mld_inc: Operation not permitted
smbmnt failed: 1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) 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