How to execute linux script line by line


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to execute linux script line by line
# 1  
Old 05-20-2011
How to execute linux script line by line

Hi All,
I have created one startup.sh file. which contain below
script. I want to start all service(meclipse, mycomputer,firefox..) with single shot. My problem is only one service can open at a time. If i close that particular service only second service will start.

Code:
cd /root/Genuitec/MyEclipse\ 8.5
./myeclipse
nautilus --no-desktop --browser  
cd /home/sivaraj/download/mysql-gui-tools-5.0
./mysql-query-browser
cd /usr/local/OnTime
./onTime 
cd /usr/bin
./thunderbird

# 2  
Old 05-20-2011
Code:
cd /root/Genuitec/MyEclipse\ 8.5
./myeclipse &
nautilus --no-desktop --browser &  
cd /home/sivaraj/download/mysql-gui-tools-5.0
./mysql-query-browser &
cd /usr/local/OnTime
./onTime &
cd /usr/bin
./thunderbird &

This User Gave Thanks to vgersh99 For This Post:
# 3  
Old 05-20-2011
Alternatively;

You can use /etc/rc.local file.

HTML Code:
cd /root/Genuitec/MyEclipse\ 8.5
./myeclipse
sleep 30
nautilus --no-desktop --browser  
cd /home/sivaraj/download/mysql-gui-tools-5.0
./mysql-query-browser
sleep 30
cd /usr/local/OnTime
./onTime
sleep 30
cd /usr/bin
./thunderbird
This User Gave Thanks to getrue For This Post:
# 4  
Old 05-20-2011
@getrue: Putting those lines in rc.local would do no good, as that is run when the system boots. Those programs, however, need a logged-in user, so most of them would fail. And it's not guaranteed that the required X11 server is already up at that stage.
This User Gave Thanks to pludi For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies

2. Shell Programming and Scripting

Modifying bash script to take each line in a file and execute command

I need to modify a bash script to to take each line in a file and execute command. I currently have this: #!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Discussion started by: galford
3 Replies

3. Shell Programming and Scripting

sed working on command line but file unchanged when execute with Shell script

I have a simple task to replace unix line feed end of line characters with carriage returns. When I run the following “change file in place” sed instruction from the command line all the Line feeds are successfully replaced with Carriage returns. sed -i 's/$/\r/' lf_file.txt But that same... (1 Reply)
Discussion started by: hawkman2k
1 Replies

4. Shell Programming and Scripting

Read line by line and execute command

Hi ALL, I have a requirement like this. 1.GET ALL TABLE NAME (just table name) keep in file 2.Read line by line and get the count of table from tablename files. tablename detail has a sql statement "db2 select tabname from syscat.tables" (1 Reply)
Discussion started by: netdbaind
1 Replies

5. Shell Programming and Scripting

Cannot execute/finish script because of last line syntax error: unexpected end of file/token `done'

first of all I thought the argument DONE is necessary for all scripts that have or begin with do statements which I have on my script, However, I still don't completely understand why I am receiving an error I tried adding another done argument statement but didn't do any good. I appreciate... (3 Replies)
Discussion started by: wolf@=NK
3 Replies

6. Shell Programming and Scripting

how to read the contents of two files line by line and compare the line by line?

Hi All, I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies

7. Shell Programming and Scripting

linux shell script to take variables from two different files line by line

Friends I need to have a shell script which will feed variables from two different files line-by-line. For example, I have two files - permission and file_name. Contents of permission is - 644 755 .... contents of file_name /file1 /file2 ..... Now I want 644 permission will be... (4 Replies)
Discussion started by: atanubanerji
4 Replies

8. Shell Programming and Scripting

How to read a file line by line and store it in a variable to execute a program ?

Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files. all my parameters files are in the same directory, so pick them up with ls *.para >>dirafter that I have a dir file like that: param1.para param2.para etc... I... (2 Replies)
Discussion started by: shadok
2 Replies

9. Shell Programming and Scripting

Execute the first line from last

Hi, I have a script xyz.sh and in this, following lines exists. #!/bin/bash ./abc.sh PB sleep 60 ./abc.sh RA sleep 60 ./abc.sh GS sleep 60 ./abc.sh S sleep 60 ./abc.sh SI sleep 60 ./abc.sh DR sleep 12000 ./abc.sh CT (9 Replies)
Discussion started by: sandy1028
9 Replies

10. Shell Programming and Scripting

How to execute the multiple line sql using shell script

Hi All, Please help me to write a shell script to execute the below sql query. select c.account_no,b.bill_no,a.pay_type,(b.total_due + b.recvd + b.adjusted + b.disputed + b.transferred) as amt_not_billed,d.cash_on_delivery, (select j.bill_no from billinfo_T y, bill_t j where... (1 Reply)
Discussion started by: girish.raos
1 Replies
Login or Register to Ask a Question