Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[BASH] stdin password
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
Anthyme
Guru
Guru


Joined: 25 Jun 2004
Posts: 498

PostPosted: Wed Apr 19, 2006 5:52 pm    Post subject: [BASH] stdin password Reply with quote

bonsoir !

Je cherche un moyen plus propre pour mon script :

Code:
echo $2 > password
echo $2 >> password
smbldap-passwd  $1  < password
rm password


smbldap-passwd est comme passwd, il demande 2 fois le mot de passe dans le stdin et je n'ai pas trouver mieu pour lui passer un password au milieu d'un script... mais ca demande des acces disques, c'est pas genial ! y'a pas mieu a faire ?
Back to top
View user's profile Send private message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Wed Apr 19, 2006 7:20 pm    Post subject: Reply with quote

Code:
echo toto | while read line;do
echo $line
sleep 1
echo $line
done | smbldap-passwd $1
Back to top
View user's profile Send private message
Ey
l33t
l33t


Joined: 07 Apr 2005
Posts: 863
Location: Paris

PostPosted: Wed Apr 19, 2006 8:11 pm    Post subject: Re: [BASH] stdin password Reply with quote

Code:
smbldap-passwd  $1  <<EOF
$2
$2
EOF
Back to top
View user's profile Send private message
Anthyme
Guru
Guru


Joined: 25 Jun 2004
Posts: 498

PostPosted: Wed Apr 19, 2006 9:03 pm    Post subject: Reply with quote

Je n'ai pas trop compris ton script baptux mais mettre un sleep 1 alors qu'on veux gagner en perf n'est pas vraiment une bonne chose ^^

sinon Ey j'aime bien ton script je pense que je vais utiliser celui la

en tout cas merci a vous 2 ;)
Back to top
View user's profile Send private message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Wed Apr 19, 2006 10:11 pm    Post subject: Reply with quote

le sleep c'est juste que d'habitude je fait ça avec un echo contenant plusieurs commandes d'affiler contenant plusieurs commandes a passer dans un telnet, et que comme certaines des commandes passées sont longues, le sleep permet de s'assurer qu'elles ont bien été passée dans le telnet.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French 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