The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Multiple processes writing on the same file simultaneously Sayantan Shell Programming and Scripting 1 01-23-2008 12:28 AM
Doubt about multiple processes Legend986 Shell Programming and Scripting 9 10-29-2007 08:49 AM
spawning multiple processes spread across two files StrengthThaDon High Level Programming 1 09-17-2007 02:03 PM
Running multiple processes in Linux abcabc1103 UNIX for Dummies Questions & Answers 2 07-09-2007 02:21 PM
How Can I Have Top Display The Top 20 Processes?? TRUEST UNIX for Dummies Questions & Answers 1 05-23-2003 05:24 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-01-2002
Registered User
 

Join Date: Oct 2002
Location: Canada
Posts: 22
Spawing multiple display processes from one shell.

Question: Suppose I want to, from the terminal, use a shell script that would do the display image.jpg command to load multiple images from a directory all at the same time. One terminal, and for example 10 image files. Basically I want to execute 10 different commands simultaniously all from the same shell and open ten different windows with the images in them.

How would this be done?

I have a basic idea with for loops, number sequences, and background processes. But is there an easy way that's pretty much universal on any unix platform?

for file in `ls -1 *.jpg`; do display $file; done

does a nice job of displaying the images in alphabetic order one by one. but I want to load em all up all at the same time from one shell.
__________________
Joe The Guy irc.linux.org #linux :)
Forum Sponsor
  #2  
Old 10-01-2002
Registered User
 

Join Date: Oct 2002
Location: Canada
Posts: 22
basically what i mean is something like this in terms of command execution

command excuted loads:
|____process-- a-|
|____process-- b-|____ * all same time
|____process-- c-|
|____process-- d-|

* all same time: split second differences don't matter really but basically the terminal is just doing a bunch of stuff all together.
__________________
Joe The Guy irc.linux.org #linux :)
  #3  
Old 10-01-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
To display all of the ... *ahem* pictures... in a directory at the same time, you can try something like:
Code:
#! /bin/ksh
for each in *.jpg; do
  /usr/bin/ee $each &
done
Substitute your file viewer for /usr/bin/ee...
The trick would be to put each one in the background... As soon as one starts, it goes into the background, and the next begins opening - although this wouldn't be simultaneous, it might work for your needs.
  #4  
Old 10-02-2002
Registered User
 

Join Date: Oct 2002
Location: Canada
Posts: 22
Hey, cool. It works. It's kinda a heavy load but it's effective. Thanks.
__________________
Joe The Guy irc.linux.org #linux :)
  #5  
Old 10-02-2002
Registered User
 

Join Date: Oct 2002
Location: Canada
Posts: 22
wow! I used that command to play multiple wav files all at the same time through esd.

The result was scary!

for file in `slocate .wav`; do esdplay $file & done

uh huh huh huh huh huh
__________________
Joe The Guy irc.linux.org #linux :)
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0