Running a queued set of commands?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running a queued set of commands?
# 1  
Old 04-24-2008
Running a queued set of commands?

Is there a way I can queue something like 800 commands in a BASH (or anything else for that matter) script?

I just basically don't want to have 800 commands pound my system at once. So far I have been just running the list (dynamically generated) through a loop, and executing every command in the background with nice in front. Only problem is that with 20 this wasn't hurting my server... at 800 I'm betting I would see CPU contention...

I'm just looking for a way to 'nicely' run a series of commands that take about 1-5 seconds a piece, executing no more than like 10 at a time (unless you have a better idea?)

Any help would be AWESOME!

- J
# 2  
Old 04-25-2008
Take a look at this post https://www.unix.com/shell-programmin...scripting.html

Jean-Pierre.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running set of commands in remote servers in shell script

Hi Wishing to all. I am very new joined in an organization as a unix system administrator. I need a help in preparing a script for a report. i have a file contains all of the linux/ubuntu servers line by line around 140 servers. vi servers.txt nh01 nh02 nh03 bh01 bh04 - - :wq (3 Replies)
Discussion started by: kumaraswamy
3 Replies

2. Shell Programming and Scripting

how do i execute a set of commands in telnet??

I have list of commands in a file in one sever and i need to execute these set of commands in the server to which i m telnetting to .. (4 Replies)
Discussion started by: nikhil jain
4 Replies

3. Shell Programming and Scripting

Using commands within the command 'set'

Hi Everyone, I'm relatively new to using c shell and I'm trying to understand a script for data processing. In it they use the set command: E.g. one such line: set scan = 'cat /home/wera/etc/.scan' When I try to test the command myself with my own files: set scan = 'cat... (1 Reply)
Discussion started by: linuxPlayer
1 Replies

4. Solaris

export vs env vs set commands

Hi I'm trying to understand variable scopes in solaris10. It is said that to display env variables we use 3 commands : - env - set - export What is the difference between them ? thx for help. ---------- Post updated at 11:00 AM ---------- Previous update was at 10:50 AM ---------- ... (2 Replies)
Discussion started by: presul
2 Replies

5. Shell Programming and Scripting

ssh - to execute set of commands

Hi Can someone help me to figure out Want to execute few cmds in remote host thru ssh Tried below cmd -------------------------------excerpt------------------- RDIR=/data1/logs ---> variable stores rem. server directory TODAY="`date '+%b %d'`" ssh -i $userid@$host "cd... (2 Replies)
Discussion started by: id100
2 Replies

6. AIX

How to set dhcp client by using commands

Hi, I have used "smit tcpip" to setup dhcp client but it does not work. Don't know why. Now I want to try using commands to do the job. I have studied commands chdev and mktcpip but did not find howto. Please help. Thank you! (1 Reply)
Discussion started by: aixlover
1 Replies

7. Shell Programming and Scripting

using nohup with set of commands

hi I want to use nohup command with set of commands .. my goofy sample : nohup while true do ; date; done and its not working . any idea ? cheers (1 Reply)
Discussion started by: kvok
1 Replies

8. Shell Programming and Scripting

How to run a set of commands through ssh

I need to run a set of commands on a remote machine using ssh. it should also collect output and return status of each command. Can someone help me how to do this? (1 Reply)
Discussion started by: vickylife
1 Replies

9. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (6 Replies)
Discussion started by: ran16
6 Replies

10. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (0 Replies)
Discussion started by: ran16
0 Replies
Login or Register to Ask a Question