Sponsored Content
Top Forums Shell Programming and Scripting Help with script to fully occupied all available cpu Post 302554388 by perl_beginner on Monday 12th of September 2011 12:31:13 AM
Old 09-12-2011
Hi yazu,

When I trying your bash script, it shown the below error message:
Code:
line 1: syntax error near unexpected token `f2'

This is the list of my available input file:
Code:
data_1.txt
data_2.txt
data_3.txt
data_4.txt

Script that I edit based on your advice:
Code:
for f1 f2 f3 f4 in *.txt; do
  ./prog $f1 > $f1.out &
  ./prog $f2 > $f2.out &
  ./prog $f3 > $f3.out &
  ./prog $f4 > $f4.out &
  wait
done

Thanks for your advice.
 

10 More Discussions You Might Find Interesting

1. Programming

How to find out the stack size occupied for a process?

Hi, In Linux how to find out what will be the stack size allocated for a process? Actually i have to fork n number of processess, and will call exec. I will be execing an executable which is already multithreaded and each thread size is defined. My doubt is how to know if the size of the... (2 Replies)
Discussion started by: rvan
2 Replies

2. UNIX for Advanced & Expert Users

so there is no way to know the size occupied by data ?

I want to find out how many disk blocks are used by only data (and not metadata) by a file. But as far as I can tell, if the file has holes, then there is no way to know this. You can find out the logical size of the file (physical size + hole blocks). You can get the physical size of the... (3 Replies)
Discussion started by: the_learner
3 Replies

3. Solaris

Command used for checking space occupied by files & sub-direc's inside a mount in %?

Hi, I want to know the command which can be used for finding the % of disk space occupied by files & sub-folders inside a given mount in Sun Solaris For eg: I have /tmp/ folder when I sat df -k it will give the percentage of space used by /tmp/. Say if I want to see how much % the files &... (2 Replies)
Discussion started by: weblogicsupport
2 Replies

4. Solaris

Hostname not fully qualified..

Hi Friends.. I have a small problem with the hostname of my system.I had installed Solaris 10 X86 on Vmware in my windows 2000 system.After booting of my solaris system,if i give check-hostname command it says ,, hostname is not fully qualified ,,change the hostname to hostname.xxx.xxxxxx.com... (3 Replies)
Discussion started by: sdspawankumar
3 Replies

5. Shell Programming and Scripting

Very Challenging Problem. Please read fully.

Hi, This is the Third thread i'm putting here for the same problem. :( Actually, i'm trying a script like this.. but its taking a long time.. about 3 days to complete fully.. #!/bin/ksh if then exit 1 fi while read i do while read j do field7=`echo $j|cut -d "|"... (12 Replies)
Discussion started by: RRVARMA
12 Replies

6. Shell Programming and Scripting

how to get fully qualified path name

hi actually i want to get fully qualified path name of the file when the file name is entered as command line argument while running a shell script ex. if i run the shell as $./test.sh ./nsdnet_file.csv the it should display me the full path of the file like /dialp/Release/bin/nsdnet_file.csv... (3 Replies)
Discussion started by: priyanka3006
3 Replies

7. Shell Programming and Scripting

script to display occupied and non occupied ports in unix

I want to extend this script. This must also be able to show me that a port is already assigned to a service but not running now there must be three different messages port 8949 is open but not listening port 8959 is open port 8999 hasn't been assigned to any service. I know that... (1 Reply)
Discussion started by: charan314
1 Replies

8. UNIX for Dummies Questions & Answers

Space occupied by core

Guys, Can some one help me? I need to find the total percent of space occupied by core files on my unix system. I know df -k will give me the percent space utilization for a directory but how do we replicate the space for a file? (3 Replies)
Discussion started by: yabhi_22
3 Replies

9. Solaris

Can't change fully qualified host name

I tried changing my /etc/inet/hosts file for my server to: <ip address> <hostname> <fqdn> but when I go to reboot the file changes right back to: <ip address> <hostname> how do I get the <fqdn> to stick on a reboot. Thanks (2 Replies)
Discussion started by: jastanle84
2 Replies

10. Shell Programming and Scripting

C Shell Script: While function not fully looping

I am new to scripting and this is probably the 4th or 5th simple script I have written. I am working with a HUGE number of data that need to be organized into folders and named a certain way. I wrote the naming script using a while function to go through the 1000-some folders and rename the files... (0 Replies)
Discussion started by: notluckyhannah
0 Replies
tryto(1)						      General Commands Manual							  tryto(1)

NAME
tryto - tries to run a command limited by a timeout or number of tries, can be used to run as svlogd(8) processor. SYNOPSIS
tryto [-pPv] [-t sec] [-k ksec] [-n tries] prog DESCRIPTION
prog consist of one or more arguments. tryto runs and watches prog, feeding its standard input to prog's standard input. If prog exits with a return code other then 0, tryto runs prog again after sleeping one second. If the number of retries reaches the maximal number of tries, tryto prints an error message and gives up. If the timeout sec seconds is reached and prog is still running, tryto sends a TERM signal to prog, waits ksec seconds for prog to termi- nate, then sends a KILL signal if prog still is there, and exits as soon as possible. OPTIONS
-t sec timeout. Set the timeout to send TERM to prog to sec seconds. Default is 180. -k ksec kill timeout. Set the timeout to send KILL to prog to ksec seconds. Default is 5. -n tries Set the maximal number of tries to tries. If prog exited with a return code other that 0, tryto tries to rewind standard input to the beginning using lseek(2) before starting prog again. Default is 5. -p processor. Use this option if you run tryto as a svlogd(8) processor (see below). -P process group. Run prog in a new session and process group, and send signals on timeout to prog's process group instead of its pid. -v verbose. Print verbose messages to standard error. PROCESSOR
If tryto sees the -p option, tryto runs as a svlogd(8) or multilog(8) processor, making use of filedescriptors 4 and 5: Before starting prog, tryto moves the filedescriptor 5 to 2, so all error messages from tryto and prog will be saved in svlogd(8)'s state to be processed on the next run of tryto -p. After starting prog, tryto first feeds all data it reads from filedescriptor 4 into prog's standard input, then all data from filedescrip- tor 0. If prog fails by timeout sec seconds or maximal number of tries, tryto prints all data from standard input to standard output, an error message to standard error, and exits with 0. EXIT CODES
If tryto itself fails, it returns 111. If tryto runs as a svlogd(8) processor, tryto returns 0 in all other cases. If prog was run successfully, tryto returns 0. If prog failed by timeout, tryto returns 100. If prog failed by maximal number of tries, tryto returns the last return code from prog. SEE ALSO
socklog(8), uncat(1), svlogd(8), multilog(8), lseek(2) http://smarden.org/socklog/ http://smarden.org/runit/ AUTHOR
Gerrit Pape <pape@smarden.org> tryto(1)
All times are GMT -4. The time now is 11:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy