Sponsored Content
Top Forums Shell Programming and Scripting Determine Number of Processes Running Post 302151820 by bakunin on Monday 17th of December 2007 01:32:00 PM
Old 12-17-2007
Quote:
Originally Posted by wayne1411
to determine the number of processes running and assign it to a variable.
To be precise:

Code:
var=$(ps -fe | wc -l)

assigns the value to variable var.

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

$A is a number / any other string? How to determine ?

I have a variable (say $A) and while passing it gets either a number or some other string. Now how can test (with if else) whether the variable is just a ne or something else ? Thanks a lot to all in advance C Saha (2 Replies)
Discussion started by: csaha
2 Replies

2. Programming

In C Program, determine if job is running

Is it possible to run the following Unix command in a C program and obtain results as to whether the job is running or not? ps -ef | grep 'job_name' | grep -v grep I'm fairly new at C and need to know what code I'd need in the C program. Thanks, in advance, for your assistance. (12 Replies)
Discussion started by: BCarlson
12 Replies

3. Shell Programming and Scripting

Keep a certain number of background processes running

I've got a bit of code I'm trying to work on... What i want to happen is ... at all times have four parallel mysql dump and imports running. I found the follow code snippet on the forum and modified it to work by starting four concurrent processes but it waits until all four are done before... (7 Replies)
Discussion started by: dgob123
7 Replies

4. UNIX for Advanced & Expert Users

How to determine the number of NFS threads RUNNING on the system

Hi, Anyone can tell me how to get the number of NFS threads RUNNING on the system for Solaris 10? Someone told me for Solaris 9, the method is "echo "*svc$<svcpool" | adb -k. But, I've tried to google the method for Solaris 10 and did not find the corresponding method, please help... (1 Reply)
Discussion started by: wang.caiqi
1 Replies

5. Shell Programming and Scripting

How to Control Number of Processes Running

Hi Is there a way to count how many processes a script has started, count how many of these have finished, and make the script wait if their difference goes over a given threshold? I am using a script to repeatedly execute a code (~100x) which converts 2 data files into one .plt which is in... (4 Replies)
Discussion started by: drbones
4 Replies

6. Shell Programming and Scripting

determine the active processes on the system which are running since long time

Hi , Please help me shell script to determine the active processes on the system which are running since long time (2 Replies)
Discussion started by: itian2010
2 Replies

7. Shell Programming and Scripting

determine the number of spaces

Here is a weird question :) i am trying to create a script written in bash that will create configuration files for nagios. As some of you aware is has to be written in the below format: define service{ option1 value1 option2 value2... (6 Replies)
Discussion started by: ppolianidis
6 Replies

8. UNIX for Dummies Questions & Answers

How do you print the number of processes that each user is currently running in Unix?

Ok, so I know there's a way to do this, but I've been trying to find out all afternoon with no luck. I think it should print out something like this: 1 bin 2 daemon 6 duo Where the numbers on the left are the number of processes being run by the user whose name is listed on the right. Is... (4 Replies)
Discussion started by: Duo11
4 Replies

9. UNIX for Dummies Questions & Answers

Determine maximum allowable processes on a platform

Hello Unix gurus, I'm creating this analysis to determine whether the maximum allowable process is nearly reached then alarm the user with it. Can someone please help me on how I can determine the maximum allowable process that a platform can handle? BTW, below are the details that might be... (0 Replies)
Discussion started by: Jin_
0 Replies

10. UNIX for Dummies Questions & Answers

How do I find the number of processes running on root?

Is there a certain man command I'm missing here? I searched in ps but I couldn't find something that would give me the number of processes running on root. I only want to see the number of processes, not the processes itself. (2 Replies)
Discussion started by: l3monz
2 Replies
GIT-VAR(1)							    Git Manual								GIT-VAR(1)

NAME
git-var - Show a Git logical variable SYNOPSIS
git var ( -l | <variable> ) DESCRIPTION
Prints a Git logical variable. OPTIONS
-l Cause the logical variables to be listed. In addition, all the variables of the Git configuration file .git/config are listed as well. (However, the configuration variables listing functionality is deprecated in favor of git config -l.) EXAMPLE
$ git var GIT_AUTHOR_IDENT Eric W. Biederman <ebiederm@lnxi.com> 1121223278 -0600 VARIABLES
GIT_AUTHOR_IDENT The author of a piece of code. GIT_COMMITTER_IDENT The person who put a piece of code into Git. GIT_EDITOR Text editor for use by Git commands. The value is meant to be interpreted by the shell when it is used. Examples: ~/bin/vi, $SOME_ENVIRONMENT_VARIABLE, "C:Program FilesVimgvim.exe" --nofork. The order of preference is the $GIT_EDITOR environment variable, then core.editor configuration, then $VISUAL, then $EDITOR, and then the default chosen at compile time, which is usually vi. GIT_PAGER Text viewer for use by Git commands (e.g., less). The value is meant to be interpreted by the shell. The order of preference is the $GIT_PAGER environment variable, then core.pager configuration, then $PAGER, and then the default chosen at compile time (usually less). SEE ALSO
git-commit-tree(1) git-tag(1) git-config(1) GIT
Part of the git(1) suite Git 1.8.5.3 01/14/2014 GIT-VAR(1)
All times are GMT -4. The time now is 05:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy