LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-26-2014, 07:42 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
Need help with scripting


I have the following commands sequence:
Code:
#yum install glibc.i686 
#useradd w1_11 
#passwd w1_11 
#chmod +x oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin
# su w1_11
$ ./oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin -mode=silent -silent_xml=silent.xml
I want to put it in shell script.
Code:
#!/bin/bash
yum install glibc.i686
useradd w1_11
cp -rf /home/w1_11/oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin /home/w1_12/
cp -rf /home/w1_11/silent.xml /home/w1_12/
chmod +x oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin
su w1_11
cd
./oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin -mode=silent -silent_xml=silent.xml
While running the above script, it is unable to maintain session during the last line script execution.

Last edited by your_shadow03; 09-26-2014 at 07:43 AM.
 
Old 09-26-2014, 09:19 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I'd try
Code:
su - w1_11
instead of
Code:
su w1_11
and add
Code:
set -x
just under
Code:
#!/bin/bash
then run the script and examine the console or terminal for additional details.
 
Old 09-26-2014, 10:50 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466

Original Poster
Blog Entries: 6

Rep: Reputation: 51
I tried that but the last line( the script didn't run) as shown below:

Code:
[root@localhost ~]# ./weblogicscript.sh
+ yum install glibc.i686
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.netnitco.net
 * extras: centos.mia.host-engine.com
 * updates: centos.eecs.wsu.edu
 * webtatic: uk.repo.webtatic.com
Package glibc-2.17-55.el7_0.1.i686 already installed and latest version
Nothing to do
+ useradd w1_12
Creating mailbox file: File exists
+ cp -rf /home/w1_11/oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin /home/w1_12/
+ cp -rf /home/w1_11/silent.xml /home/w1_12/
+ chmod +x oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin
+ su - w1_12
[w1_12@localhost ~]$
How to make it work?
 
Old 09-26-2014, 11:16 AM   #4
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466

Original Poster
Blog Entries: 6

Rep: Reputation: 51
Fixed it through the following script:
[code]
#!/bin/bash
set -x
yum install glibc.i686
useradd w1_11
cp -rf /home/w1_11/oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin /home/w1_11/
cp -rf /home/w1_11/silent.xml /home/w1_11/
chmod +x oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin
su - w1_11 -c './oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin -mode=silent -silent_xml=silent.xml'

[code]
 
  


Reply



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
[SOLVED] Need Help Scripting? amber1 Linux - Newbie 12 03-06-2013 04:19 PM
scripting pradeep rawat Linux - Newbie 10 11-30-2012 09:44 AM
LXer: Scripting the Linux desktop, Part 2: Scripting Nautilus LXer Syndicated Linux News 0 02-17-2011 04:02 AM
Firefox Scripting Add-on (Scripting HTML / Javascript inside Firefox) linuxbeatswindows Programming 1 09-18-2009 10:09 PM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration