FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 11-04-2010, 08:52 PM
nani
 
Default Script required

Hi,

Is there any way to provide password from the bash script, please let me
know the script

there is some package in which it will ask for username and password, we
wanted to have this installation by script

./vasInstall.ksh <<EOF
yes
ad1

ibmi1530
PASSWORD
EOF
this password it is not taking through script

can you people suggest some other way to that

Thanks and Regards,
Srinath
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 11-04-2010, 09:53 PM
Jonathan Billings
 
Default Script required

On Nov 4, 2010, at 5:52 PM, nani wrote:
> Is there any way to provide password from the bash script, please let me
> know the script
>
> there is some package in which it will ask for username and password, we
> wanted to have this installation by script
>
> ./vasInstall.ksh <<EOF
> yes
> ad1
>
> ibmi1530
> PASSWORD
> EOF
> this password it is not taking through script
>
> can you people suggest some other way to that

You probably could use 'expect' (which uses Tcl) to automate interacting with the script. This isn't a bash script, but you'll be able to interact with the ksh script as if it were an interactive process. If you don't like tcl, there are Python and Perl expect modules as well.

--
Jonathan Billings <jsbillin@umich.edu>
College of Engineering - CAEN - Unix and Linux Support





--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 11-04-2010, 11:34 PM
"Carl T. Miller"
 
Default Script required

Jonathan Billings wrote:
> On Nov 4, 2010, at 5:52 PM, nani wrote:
>> Is there any way to provide password from the bash script, please let me
>> know the script
>
> You probably could use 'expect' (which uses Tcl) to automate interacting
> with the script. This isn't a bash script, but you'll be able to interact
> with the ksh script as if it were an interactive process. If you don't
> like tcl, there are Python and Perl expect modules as well.

Or you could investigate the --stdin option for passwd
which will accept a string from a piped command. Something
like this might work:

while read Username Password; do
echo "$Password" | passwd --stdin $Username
done << somefile

c


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 04:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org