Visit Our UNIX and Linux User Community


Spawing multiple display processes from one shell.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Spawing multiple display processes from one shell.
# 1  
Old 10-01-2002
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.
# 2  
Old 10-01-2002
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.
# 3  
Old 10-01-2002
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
Hey, cool. It works. It's kinda a heavy load but it's effective. Thanks.
# 5  
Old 10-03-2002
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

Previous Thread | Next Thread
Test Your Knowledge in Computers #471
Difficulty: Medium
Google recommends that users configure Google Public NTP together with non-leap-smearing NTP servers.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to display processes which have been running for more than a X hours?

Hi, Is it possible to display processes which have been running for more than a 5hrs using a variation of the ps -ef command? Regards, Manny (5 Replies)
Discussion started by: mantas44
5 Replies

2. Homework & Coursework Questions

Display info about users (UID GID processes terminal)

I would like to get an opinion for my solution for this task and get feedback about better approach or mistakes I have made. 1. The problem statement, all variables and given/known data: The task is to create a script which prints information about users whose names are specified in the... (2 Replies)
Discussion started by: kornfan
2 Replies

3. Linux

How to display all daemon processes in priority order?

Hi, Is there any way to run chkconfig --list and to display all daemon processes in PRIORITY order, not in alphabetic order? Thank you. (4 Replies)
Discussion started by: hce
4 Replies

4. Shell Programming and Scripting

need help ps -e on multiple processes

:)Hi there, I am new to scripting and wanted to see if someone can show me how to grep on multiple processes and send the output to a file in /home/mydir/output. I am aware of ps -ef | grep on 1 process but need help looking up multiple processes, can you use this command ps -elf | grep |pid1... (4 Replies)
Discussion started by: abbya
4 Replies

5. Shell Programming and Scripting

kill multiple processes by name

Want to kill multiple processes by name. for the example below, I want to kill all 'proxy-stagerd_copy' processes. I tried this but didn't work: >> ps -ef|grep proxy_copy root 991 986 0 14:45:34 ? 0:04 proxy-stagerd root 1003 991 0 14:45:49 ? 0:01... (2 Replies)
Discussion started by: catalinawinemxr
2 Replies

6. Programming

Creating Multiple Processes

I am having problems creating multiple forks. I want create a certain number of forks, each call a program and each wait for a different value. How is this accomplished my loop is not doing the trick. for (i = 0; i < 5; i++) { if (fork() < 0) { //print error } ... (3 Replies)
Discussion started by: Vikings1201
3 Replies

7. Shell Programming and Scripting

Scripting Help - Display Processes

Hi, I was wondering if somebody could help me as I am struggling with writing a script for a training course. Ive had to write 5 scripts and this is the last one but am struggling with this even though I understand what it is meant to do..... PROBLEM: write a script which will allow you to... (1 Reply)
Discussion started by: isxrc
1 Replies

8. Shell Programming and Scripting

How to display what processes, users have opened at a given time

Hello, What i have to do is make a top 10 list of users sorted by the number of processes opened at a given time. Can anyone help me with finding out for a given moment, for all users how many processes each had opened? (5 Replies)
Discussion started by: gabibyte
5 Replies

9. Shell Programming and Scripting

multiple processes overlap

Hello I've got a script that creates multiple processes, in ksh, to bcp out 6 tables at a time. In the script, we write messages to the log to show our progress; most of the time, the log messages are nice and neat with one per line, like they should be. But every once in awhile, at random, the... (2 Replies)
Discussion started by: stonemonolith
2 Replies

10. Shell Programming and Scripting

Doubt about multiple processes

Suppose that I am performing some operation on an sql database. Lets say process of Searching and then if a value is found, updating it... Now, when I have some millions of records on which the operation has to be performed... Does it help to spawn multiple processes each executing the same... (9 Replies)
Discussion started by: Legend986
9 Replies

Featured Tech Videos