Hello everyone, say I have the following script, which contains serveral loops, if I run the script, it executes the loop one by one (after the a loop, it goes to b loop, then c, then d)
I figured I should be able to run all the loops at same time, but I don't know how, can anyone help a little bit here? thanks!
for file in `ls a*`; do commanda ; done
for file in `ls b*`; do commandb ; done
for file in `ls c*`; do commandc ; done
for file in `ls d*`; do commandd ; done
Not only is ls unnecessary, but it will break your script if any of the filenames contain spaces.
So I have yet another query which requires the genius of the users on Unix.com. Having asked around at my work (Tech company) No one can really answer my question thoroughly.
My goal is to get 2 Hard drives running at the same time and allow me to switch between working on one to the other.... (4 Replies)
Hi,
I want to run the command below in the background:
tail -f file.txt | grep "pattern"
The file file.txt will start getting its contents written after this command has started getting run.
So the flow will be like this
tail -f file.txt | grep "pattern"
#The line below will write data... (0 Replies)
Hi All
I have a file for ex .log file which contain several lines within it.
I have to read that file contents & assing that to a variable. (2 Replies)
Hello guys,
i'm searching for a solution how to download all files from root-directory of an ftp-server through an ftp proxy
getting through the ftp proxy and download one file with get ist no problem, but mget * does nothing!
ftp -n -i -v <<EOF
open proxyHost proxyPort
user... (19 Replies)
Hi all,
I'm having a problem with a script which should ultimately provide a filename by reading a value from file1 and file2 then join together.
I'm planning to use a loop/ loops to get the values out of both files and create a single string unfortunately the code currently treats the second... (7 Replies)
#!/bin/sh
firefox index.html
firefox secondpage.html
hey guys, im not able to open up two pages at the same time...
it always open up index.html first, and only after i close it, then the 2nd page pops up...
is there any way i can run both commands at the same time?
i appreciate any... (2 Replies)
Flow of program:
C based CGI is used
CGI1:
-Gets called when user hits upload button(submit) ie form action = CGI1
-Does the file upload (copy to a directory etc)
JS, Ajax fucntion:
-A JS function is called when user hits upload button
-The JS function opens an Ajax request for CGI2... (8 Replies)
i Run 2 scripts on all of around 50 nodes every day.
1.Mod_1.sh
2.Mod_2.sh
eg..
i run file with specific node no like
Mod_1.sh NODE_(node number)
Mod_2.sh NODE_(node number)
I want to run both file by using single script with unique node number.
Eg..
Mod_new.sh NODE_(node... (11 Replies)
Hello,
I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out.
I am specifically facing issues while running for loops.
I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Hello,
I need to run multiple shell processes simultaneously and output of the first process shall be the input of the second process but first process is never ending so both should be running in parallel. I do not wish to wait the end of the first process. I am under ubuntu 16.04.
... (3 Replies)
Discussion started by: baris35
3 Replies
LEARN ABOUT PLAN9
break
break(1) User Commands break(1)NAME
break, continue - shell built-in functions to escape from or advance within a controlling while, for, foreach, or until loop
SYNOPSIS
sh
break [n]
continue [n]
csh
break
continue
ksh
*break [n]
*continue [n]
DESCRIPTION
sh
The break utility exits from the enclosing for or while loop, if any. If n is specified, break n levels.
The continue utility resumes the next iteration of the enclosing for or while loop. If n is specified, resume at the n-th enclosing loop.
csh
The break utility resumes execution after the end of the nearest enclosing foreach or while loop. The remaining commands on the current
line are executed. This allows multilevel breaks to be written as a list of break commands, all on one line.
The continue utility continues execution of the next iteration of the nearest enclosing while or foreach loop.
ksh
The break utility exits from the enclosed for, while, until, or select loop, if any. If n is specified, then break n levels. If n is
greater than the number of enclosing loops, the outermost enclosing loop shall be exited.
The continue utility resumes the next iteration of the enclosed for, while, until, or select loop. If n is specified then resume at the n-
th enclosed loop. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be used.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words that follow a command preceded by ** that are in the format of a variable assignment are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign, and also that word splitting and file name genera-
tion are not performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), exit(1), ksh(1), sh( 1), attributes(5)SunOS 5.10 17 Jul 2002 break(1)