LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-06-2009, 09:44 AM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Bash shell script question...


Let's say I have a script that opens Gedit when Gnome comes on in Ubuntu, how would I make the script so that 2 or more Gedits open when I boot into Gnome??
Basically it would just launch 2 or more Gedit's simultaneously-but could I also make it so that there is a slight pause before each one opens, so that it won't overload something-like a 1 second pause between instances appearing??
And no, I'm not really talking about Gedit, but any app...
Thanks
 
Old 04-06-2009, 10:04 AM   #2
rizwanrafique
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147

Rep: Reputation: 19
Code:
for num in 1 2 3; do 
    gedit --new-window
    sleep 1s 
done
And yes you can use any other than gedit there :-)
 
Old 04-06-2009, 10:12 AM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OK-but I gotta break down and tell you what I'm trying to do for my own clarity...

With Billix there is a script- "dsl-linux.sh", which brings up an instance of Qemu playing DSL out of the folder/USB/CD.

I have modified this script heavily and have it working correctly-'cause if you use Billix and try to use this script it won't work 'cause there are piece's missing from the Billix Qemu folder.
Anyway, I have fixed the script and added the missing components and everything works great now-see screen shot here-reply#92

( http://www.linuxquestions.org/questi...-works-714322/ )

Anyway-so I wanna be able to invoke the script and call up the Qemu's one at a time-but automatically and make it so that it can ad-infinitum by uncommenting,etc.
 
Old 04-06-2009, 10:15 AM   #4
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Sorry-I forgot to include the script!

Code:
qemu/qemu -L qemu/ -soundhw sb16 
-kernel linux24 -initrd minirt24.gz 
-hda KNOPPIX/KNOPPIX -hdb qemu/harddisk 
-append "qemu frugal quiet modules=hdb 
nousb noscsi nofirewire atapicd noideraid 
noacpi acpi=off noapm noagp nomce"

Last edited by linus72; 04-06-2009 at 10:17 AM.
 
Old 04-06-2009, 01:01 PM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Here's my script so far but I can't figure out how to make it pop up 1 or more Qemu's simultaneously once invoked.
As it is now it opens and runs 1 Qemu, then when ypu click on the X button to kill Qemu another pops up, etc.
That's not what I want..how do I make it pop up each instance of Qemu automatically at about an interval of 1-3 seconds???


Code:
#!/bin/sh
# $Id: invoke Qemu ad-infinitum, boots multiple instances of DSL playing
# on Qemu 04/06/09 root Exp root $
# -------------------------------------------------------------------------
# Purpose:
#   To have the ability to play an infinite number of DSL's on Qemu VM's
#   while inside the livecd/usb, within another Virtual system, and out
#   of the folder on your Desktop!
# Needed:
#   My MultiDistro-ToolKit-v4.20.iso CD, or DSL-embedded.zip, or Billix.
# Author:
#   Bryan Starr <thepenandpaper@gmail.com> 04/06/09
# -------------------------------------------------------------------------

Path=dsl-linux.sh

for num in 1 2 3; do 
    qemu/qemu -L qemu/ -no-kqemu -soundhw sb16 -kernel linux24 -initrd minirt24.gz -hda DSL/KNOPPIX -append "qemu frugal   quiet modules=hdb nousb noscsi nofirewire atapicd noideraid noacpi acpi=off noapm noagp nomce vga=791 BOOT_IMAGE=knoppix knoppix_dir=DSL KNOPPIX_DIR=DSL"
    sleep 1s 
done
I know it's something simple-but I'm a newb too.
 
Old 04-06-2009, 01:07 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
you could add the "&" to put the process in the background.
 
Old 04-06-2009, 01:13 PM   #7
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
What do you mean "&", put it where?
Basically when I invoke the script I want 1+ instances of Qemu playing DSL. Each instance would "appear" at about a second apart or so.
So, it needs to have a variable to set how many pop up and how far apart in time they each pop up-right?
Like say I want it to open 3 Qemu's at 2 seconds apart-like that.
 
Old 04-06-2009, 01:17 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Code:
for num in 1 2 3; do 
    qemu &
    sleep 1s 
done
 
Old 04-06-2009, 01:31 PM   #9
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Your A Bad MoFO Repo!

Ha!

Here's what I got now-calls each one up about a second apart too.

Code:
#!/bin/sh
# $Id: invoke Qemu ad-infinitum, boots multiple instances of DSL playing
# on Qemu 04/06/09 root Exp root $
# -------------------------------------------------------------------------
# Purpose:
#   To have the ability to play an infinite number of DSL's on Qemu VM's
#   while inside the livecd/usb, within another Virtual system, and out
#   of the folder on your Desktop!
# Needed:
#   My MultiDistro-ToolKit-v4.20.iso CD, or DSL-embedded.zip, or Billix.
# Author:
#   Bryan Starr <thepenandpaper@gmail.com> 04/06/09
# -------------------------------------------------------------------------


for num in 1 2 3; do 
    qemu/qemu -L qemu/ -no-kqemu -soundhw sb16 -kernel linux24 -initrd minirt24.gz -hda DSL/KNOPPIX -append "qemu frugal   quiet modules=hdb nousb noscsi nofirewire atapicd noideraid noacpi acpi=off noapm noagp nomce vga=791 BOOT_IMAGE=knoppix knoppix_dir=DSL KNOPPIX_DIR=DSL" &
    sleep 1s 
done
That's awesome, strangely it's not actually using the "dsl-linux.sh" at all-I had to input the dsl-linux.sh directly instead of "dsl-linux.sh &"
so I removed the "Path" command.
How do I get it to find the dsl-linux.sh, I tried "Path=dsl-linux.sh" and "Path=/dsl-linux.sh" neither worked but it's all in the same folder.
I don't need it but would like to know.
And thanks Repo-you get the official name of the script-"repolator.sh" or what?
 
Old 04-06-2009, 01:40 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
is dsl-linux.sh the script you want to execute?
I don't see it in the script...
perhaps
./dsl-linux.sh &
 
Old 04-06-2009, 02:05 PM   #11
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
That's the entirety of dsl-linux.sh below no bin bash or anything.
That's the original from Billix-0.24

Code:
qemu/qemu -L qemu/ -soundhw sb16 
-kernel linux24 -initrd minirt24.gz -hda 
KNOPPIX/KNOPPIX -hdb qemu/harddisk -append 
"qemu frugal quiet modules=hdb nousb noscsi 
nofirewire atapicd noideraid noacpi acpi=off 
noapm noagp nomce"
It is missing some things and sloppily written 'cause there is no "qemu/qemu", no "-hdb qemu/harddisk" and so no "modules=hdb" 'cause there is no "hdb".

If you've been reading my post about my multidistro stuff-I couldn't get dsl-linux.sh to work, so i started looking around in the Billix/qemu folder snd it's missing both "qemu" and "harddisk"!
I found an obscure UK mirror hosting Billix old and new, was able to peer inside each one and discovered Billix-0.18 was the last time the qemu folder had "qemu" and "harddisk"!
This kinda pissed me off 'cause whoever puts out Billix has put out 4 versions since 0.18 and none of them work!
I downloaded ver 0.18, added the "qemu" and "harddisk" to the 0.24 qemu folder and it still wouldn't go!
Damn it Jim!

I now have it down pat-maybe.
The original line above has been modified to my version at the above reply.
The "harddisk" thing is 48MB and must be DSL or something 'cause when I did get 0.24 working, an old version of DSL popped up-because it was using the "harddisk" from 0.18 which has an older version of DSL!

To make problems worse-the DSL folder in Billix-0.24 is named"KNOPPIX" and would not work till I made it "DSL"

So, after editing it this whole weekend and hunting down google I finally got it!

Wanna see a cool screen shot?
The screenshot on my "project post", reply#92
That's Billix DSL running live off my USB while 3 Qemu's play-note only 125MB RAM used too!
( http://www.linuxquestions.org/questi...322/page7.html )

Anyway Repo I got it all working now and about to release my greatest ever MultiDistro-ToolKit-v4.20 for CD/USB!
Now it can play DSL on Qemu ad-infinitum via "repolator.sh"!
The new multidistro is 492MB and has all this-
1 SystemRescueCD-1.1.7 (just came out today)
2 UltimateBootCD-4.1.1
3 DSL-4.4.10 (w/"repolator.sh" & "repolator.bat" for Linux/Windows)
4 NetbootCD-2.2 (net-installs Ubuntu/Debian/Fedora/Slackware/CentOS/OpenSUSE and Mandriva!
5 ZorOS-3.4 (Slackware based-awesome HW detection!
6 NTPassWord
7 Balder(FreeDOS)

That's a hellacious toolkit for a 512MB USB huh?
I'm getting ready to upload it now...

Last edited by linus72; 04-06-2009 at 02:07 PM.
 
Old 04-06-2009, 03:35 PM   #12
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OK-now how do I make the .bat file do the same as the repolator.sh?
That is, create multiple instances of qemu when it's executed?

Code:
REM Start qemu on windows.

@ECHO OFF



START qemu\qemu.exe -L qemu/ -no-kqemu -m 
128 -soundhw sb16 -localtime -kernel linux24 
-initrd minirt24.gz -hda KNOPPIX/knoppix 
-append "qemu sb=0x220,5,1,5 frugal quiet 
noscsi nousb nofirewire atapicd noideraid 
noacpi acpi=off noapm noagp ide1=noprobe 
ide2=noprobe nomce BOOT_IMAGE=knoppix 
knoppix_dir=DSL KNOPPIX_DIR=DSL" 



CLS

EXIT
I really am not familiar with .bat files...
 
  


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
bash shell script question shurjo Programming 7 01-12-2009 05:26 AM
Bash shell script question yao_man Linux - Newbie 18 05-19-2008 08:17 AM
bash shell script question noisewater Programming 3 11-14-2005 09:39 PM
Bash shell script moodupani Linux - General 2 09-01-2005 07:14 AM
bash shell script globeTrotter Linux - Newbie 5 06-03-2004 06:07 AM


All times are GMT -5. The time now is 11:19 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