Re: Simple shell question
- From: "Theo v. Werkhoven" <theo@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 27 May 2007 01:17:46 +0200
The carbonbased lifeform Michael Soibelman inspired alt.os.linux.suse with:
I don't write shell commands very often and I'm sure this should be quite
simple. I'm trying to write a script to start my J2EE server so I don't
have to do it manually. In case you are wondering I'm just doing it for
fun now and maybe I'll write a java application soon. I have NetBeans for
that. Here's what I do manually.
1. cd to the directory where the application launcher is
(/home/mike/SDK/bin)
2. su
3. password
4. (run this command) ./asadmin start-domain domain1
That's it. Simple. So what are the exact lines so I can copy and paste in
my editor (nedit) ??
"exact lines" ?? You want cookies with that too?
#v+
#!/usr/bin/env expect
cd /home/mike/SDK/bin
spawn su - mike
expect "Password: "
send "xxxxx\n"
expect -re "^(.*)# " #insert Prompt here
send "./asadmin start-domain domain1\n"
interact
#v-
Not tested of course
Theo
--
theo at van-werkhoven.nl ICQ:277217131 SuSE Linux
linuxcounter.org: 99872 Jabber:muadib at jabber.xs4all.nl AMD XP3000+ 1024MB
"ik _heb_ niets tegen Microsoft, ik heb iets tegen
de uitwassen *van* Microsoft"
.
- Follow-Ups:
- Re: Simple shell question
- From: Michael Soibelman
- Re: Simple shell question
- References:
- Simple shell question
- From: Michael Soibelman
- Simple shell question
- Prev by Date: Re: YouTube lockup in Firefox
- Next by Date: Re: Size of a directory
- Previous by thread: Simple shell question
- Next by thread: Re: Simple shell question
- Index(es):
Relevant Pages
|