LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-21-2011, 11:04 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 486

Rep: Reputation: 31
How to write a script which will take in the password automatically?


Hi,

I have a script under /etc/init.d/jboss

When I start the Jboss under my user account (assumed test) I type:
Code:
[test ~]#/etc/init.d/jboss start
And it will ask me for paaword:
Code:
Password:
And I have to type the password.

I find this is quite boring. So I want to write a script locally (assumed called myJboss) so when I want to start the Jboss I just type in:
Code:
[test ~]#myJboss start [password]
And this script will not ask me for password anymore.


Regards

Thomas
 
Old 03-21-2011, 11:11 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 869Reputation: 869Reputation: 869Reputation: 869Reputation: 869Reputation: 869Reputation: 869
http://linux.die.net/man/1/expect

I believe this is relevant to your issue. I've never had to use it though, so I'm unsure of how to give you an example.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically mount and write to drives without a password AGazzaz Ubuntu 3 09-22-2009 08:57 AM
i need to write a script that automatically logins venix Linux - Newbie 3 03-03-2009 01:34 PM
need help to write script to check the process health and automatically restart it dragondad Programming 3 11-01-2006 12:23 PM
write a script to automatically post to a blog??? Hosiah Linux - General 11 10-14-2005 11:30 AM
i need to write a program it has to execute automatically ykirankumar Linux - Software 5 08-31-2004 12:34 AM


All times are GMT -5. The time now is 02:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration