multhreading in bash shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers multhreading in bash shell
# 1  
Old 08-30-2012
multhreading in bash shell

Code:
search1 (){
for i in $FC
do
    for j in $SC
    do
        for k in $TC
        do
            for l in $UP
            do
                for m in $LP
                do
                    for n in $LC
                    do
                        echo -n "$i$j$k$l$m$n "
                        test=`mkpasswd -m sha-512 $i$j$k$l$m$n -s $salt | cut -d":" -f2 | cut -d"$" -f4`
                        if [ $test == $encr ] ; then
                            echo "Password is: $i$j$k$l$m$n" 
                            exit
                        fi
                    done
                done    
            done
        done
    done
done
}   

    search1 job1 &
    search2 job2 &
    search3 job3 &
    search4 job4 &
    search5 job5 &
    search6 job6 &
    search7 job7 &
    search8 job8 &
    search9 job9 &

    wait

The function search1() is almost similar to other 8 functions but the program wouldn't stop if either of the function manages to find the password. It will output "Password : abcdef" and other functions will continue running till the end. How do I stop the program from after it outputs the password?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies

2. Shell Programming and Scripting

Different behavior between bash shell and bash script for cmd

So I'm trying to pass certain json elements as env vars and use them later on in a script. Sample json: JSON='{ "Element1": "file-123456", "Element2": "Name, of, company written in, a very weird way", "Element3": "path/to/some/file.txt", }' (part of the) script: for s... (5 Replies)
Discussion started by: da1
5 Replies

3. UNIX for Dummies Questions & Answers

Which of the following command displays your login shell in bash shell?

Options:: A)$shell B)echo $ bash C)echo $ O D)$ O (1 Reply)
Discussion started by: raghugowda
1 Replies

4. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

5. Shell Programming and Scripting

bash shell

#!/bin/bash declare -a dirs index=0 for dir in `ls -d */` do dirs=$dir echo $index. $dir index=`expr $index + 1` done Its giving me distorted output: c.sh: dirs=1/: No such file or directory 0. 1/ c.sh: dirs=11844/: No such file or directory 1. 11844/ c.sh: dirs=12819/: No such... (3 Replies)
Discussion started by: uunniixx
3 Replies

6. Shell Programming and Scripting

Bash Shell to sh Shell In a Script

Hi All, I am in Bash Shell and Running A script that contains Exit statement in that in last ( to return to sh shell after executing) But it is not coming to sh shell after the script is excuted. How to return to sh shell from bash shell through a script. (8 Replies)
Discussion started by: saurabh84g
8 Replies

7. Shell Programming and Scripting

c shell instead of bash

(reposting this with a better title) Cool. I played with scripts at home over the weekend. Come to find out not working on other shells. I have linux/bash at home, but now I'm trying on Solaris csh. How would I write the following script for Solaris C shell? ---------- #!/bin/bash... (0 Replies)
Discussion started by: ajp7701
0 Replies

8. Shell Programming and Scripting

Run a C Shell using only Bash shell

Hi, I have only bash on my system. And I want to run a C shell... Is there a way for that? (3 Replies)
Discussion started by: HSN
3 Replies

9. Linux

Bash Shell

How do i get rid of those blue & other colors in bash, i just want to have the text all the same, I use PuTTY and the colors up against my black backdrop and green test does not go well/ (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

10. Shell Programming and Scripting

Bash shell ...

Hi All, I am using HP-UX. Here ksh is configured as a default shell. How can i change this to bash. And please let me know of any freely available X-Terminals through which i can connect to Unix system from Windows. Regards, Vijay Hegde (2 Replies)
Discussion started by: VijayHegde
2 Replies
Login or Register to Ask a Question
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)