LinuxQuestions.org
Register a domain and help support LQ
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, 08:42 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
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 08:43 AM.
 
Old 09-26-2014, 10:19 AM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,667
Blog Entries: 10

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
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, 11:50 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
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, 12:16 PM   #4
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
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


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


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration