Sponsored Content
Top Forums Shell Programming and Scripting Bash script multithread in group of 3 Post 302426108 by Gyeah11 on Monday 31st of May 2010 08:32:22 PM
Old 05-31-2010
Bash script multithread in group of 3

I Have an script like


./bang 1
./bang 2
./bang 3
./bang 4
./bang 5
./bang 6
./bang 7
./bang 8
./bang 9
./bang 10
./bang 11
./bang 12


and i wanna execute him in groups of 3 , i mean he execute bang 1 , bang 2 and bang 3 after it finish the next 3 commands it will be executed and so on , in groups of 3.


Regards
John Hardey
 

9 More Discussions You Might Find Interesting

1. Programming

Timeout with multithread server

I wrote a server which creates a thread for every client connection. I have to include timeout function that will kill the server thread if the client doesn't respond for specific time. That too using signal(SIGALRM). For this i am using alarm() function. When the server thread detects signal it... (1 Reply)
Discussion started by: Nads
1 Replies

2. Programming

Multithread,libcurl

Hi i m codding a programm,it can download any packet from ftp,I use libcurl library. But i want to use threads for downloading.(Multithreading).i cant get ftp file size from ftp and divide packet small pieces,like threads use. Please share your experince with me ,thanks. (0 Replies)
Discussion started by: canerbulut
0 Replies

3. Programming

Multithread app - Read-Only Data

Hello, I'm coding an application using pthreads.At some point the threads will read some read-only variables.Is it safe NOT to use mutexes, in order to make the program lighter since mutex operations are resource-demanding... Thanks (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

4. Programming

[C] Multithread Server

Hi all,i'm new on this forum, excuse me for my english. I have wrote a server that accept connection from multiple client with the fork,but every client had to insert data in a linear list. The problem is that every client insert data in an own copy of the linear list and this is caused by... (7 Replies)
Discussion started by: kemistry
7 Replies

5. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

6. Solaris

How to find an application running on multithread?

Dear Friends, We have one T5240 server with 128vcpus in our lab.Performance of the server is very poor. Application uses only 2% of processor..I heard that single thread application performs slowly in coolthread.How can we find whether the application running on multithread or single thread? If... (7 Replies)
Discussion started by: nicktrix
7 Replies

7. Red Hat

Kcryptd - Which kernel supports MultiThread

I am currently have Centos 5.5 which consumes more CPU waiting for Kcrypt process. Later came to know that kcrypt is single threaded and hence consumes one CPU, results in performance degradation. Does any one really knows/practically experimented multithread of Kcryptd process with any of... (1 Reply)
Discussion started by: ragavendraganes
1 Replies

8. Shell Programming and Scripting

Sending email to group in bash

In shell scripting, TestEmail is an existing group email. I am using the below command to send emails who are existed under TestEmail . Unable to receive the email. I have tried group ="id1 id2 " .Its working and i tried creating alias as well. Can we do it without creating alias or group ="id1... (1 Reply)
Discussion started by: thomas9192
1 Replies

9. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
PKEXEC(1)							      pkexec								 PKEXEC(1)

NAME
pkexec - Execute a command as another user SYNOPSIS
pkexec [--version] [--disable-internal-agent] [--help] pkexec [--user username] PROGRAM [ARGUMENTS...] DESCRIPTION
pkexec allows an authorized user to execute PROGRAM as another user. If username is not specified, then the program will be executed as the administrative super user, root. RETURN VALUE
Upon successful completion, the return value is the return value of PROGRAM. If the calling process is not authorized or an authorization could not be obtained through authentication or an error occured, pkexec exits with a return value of 127. If the authorization could not be obtained because the user dismissed the authentication dialog, pkexec exits with a return value of 126. AUTHENTICATION AGENT
pkexec, like any other polkit application, will use the authentication agent registered for the calling process or session. However, if no authentication agent is available, then pkexec will register its own textual authentication agent. This behavior can be turned off by passing the --disable-internal-agent option. SECURITY NOTES
Executing a program as another user is a privileged operation. By default the action to check for (see the section called "ACTION AND AUTHORIZATIONS") requires administrator authentication. In addition, the authentication dialog presented to the user will display the full path to the program to be executed so the user is aware of what will happen. The environment that PROGRAM will run it, will be set to a minimal known and safe environment in order to avoid injecting code through LD_LIBRARY_PATH or similar mechanisms. In addition the PKEXEC_UID environment variable is set to the user id of the process invoking pkexec. As a result, pkexec will not by default allow you to run X11 applications as another user since the $DISPLAY and $XAUTHORITY environment variables are not set. These two variables will be retained if the org.freedesktop.policykit.exec.allow_gui annotation on an action is set to a nonempty value; this is discouraged, though, and should only be used for legacy programs. Note that pkexec does no validation of the ARGUMENTS passed to PROGRAM. In the normal case (where administrator authentication is required every time pkexec is used), this is not a problem since if the user is an administrator he might as well just run pkexec bash to get root. However, if an action is used for which the user can retain authorization (or if the user is implicitly authorized) this could be a security hole. Therefore, as a rule of thumb, programs for which the default required authorization is changed, should never implicitly trust user input (e.g. like any other well-written suid program). ACTION AND AUTHORIZATIONS
By default, the org.freedesktop.policykit.exec action is used. To use another action, use the org.freedesktop.policykit.exec.path annotation on an action with the value set to the full path of the program. In addition to specifying the program, the authentication message, description, icon and defaults can be specified. If the org.freedesktop.policykit.exec.argv1 annotation is present, the action will only be picked if the first argument to the program matches the value of the annotation. Note that authentication messages may reference variables (see the section called "VARIABLES"), for example $(user) will be expanded to the value of the user variable. WRAPPER USAGE
To avoid modifying existing software to prefix their command-line invocations with pkexec, it's possible to use pkexec in a she-bang wrapper[1] like this: #!/usr/bin/pkexec /usr/bin/python import os import sys print "Hello, I'm running as uid %d"%(os.getuid()) for n in range(len(sys.argv)): print "arg[%d]=`%s'"%(n, sys.argv[n]) If this script is installed into /usr/bin/my-pk-test, then the following annotations [...] <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/python</annotate> <annotate key="org.freedesktop.policykit.exec.argv1">/usr/bin/my-pk-test</annotate> [...] can be used to select the appropriate polkit action. Be careful to get the latter annotation right, otherwise it will match any pkexec invocation of /usr/bin/python scripts. VARIABLES
The following variables are set by pkexec. They can be used in authorization rules and messages shown in authentication dialogs: program Fully qualified path to the program to be executed. Example: "/bin/cat" command_line The requested command-line (do not use this for any security checks, it is not secure). Example: "cat /srv/xyz/foobar" user The user name of the user to execute the program as. Example: "davidz" user.gecos The full name of the user to execute the program as. Example: "David Zeuthen" user.display A representation of the user to execute the program as that is suitable for display in an authentication dialog. Is typically set to a combination of the user name and the full name. Example: "David Zeuthen (davidz)" AUTHOR
Written by David Zeuthen <davidz@redhat.com> with a lot of help from many others. BUGS
Please send bug reports to either the distribution or the polkit-devel mailing list, see the link http://lists.freedesktop.org/mailman/listinfo/polkit-devel on how to subscribe. SEE ALSO
polkit(8), polkitd(8), pkaction(1), pkcheck(1), pkttyagent(1) NOTES
1. she-bang wrapper http://en.wikipedia.org/wiki/Shebang_(Unix) polkit May 2009 PKEXEC(1)
All times are GMT -4. The time now is 06:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy