Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Error in script while counting processes Post 302892267 by MadeInGermany on Tuesday 11th of March 2014 09:50:11 PM
Old 03-11-2014
The following are more precise perhaps (you didn't provide a ps output)
Code:
$( ps -ef | grep -c 'dw[.]sap' )

Code:
$( ps -ef | grep -wc 'dw[.]sap' )

This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Counting Processes

I have a simple script that I want to notify me whenever there are anything other than one instance of a particular process running. I've always used the script: DPID_DW=$(ps -ef | grep | wc -l) if then echo "The data warehouse manager for DB is down" elif then ... (4 Replies)
Discussion started by: heprox
4 Replies

2. Shell Programming and Scripting

problem with the script in counting

Hi, I have a script which greps for a word in a file contains records. I grabbed a particular column & sent the colomn values to a file. I need to find each column value, the times it appeared in the file. My script is: grep sceneority <file> | cut -f 6 >> swi With... (4 Replies)
Discussion started by: pradeep_script
4 Replies

3. UNIX for Dummies Questions & Answers

[solved] Error Executing the script.

# cat SERVERNAMES 10.180.8.231 10.180.8.232 10.180.8.233 10.180.8.234 10.180.8.235 10.180.8.236 10.180.8.237 10.180.8.238 10.180.9.239 fn_Exit() { echo "Machine Doesnt exist" exit 1 #exit shell script } (2 Replies)
Discussion started by: pinga123
2 Replies

4. Shell Programming and Scripting

help with counting processes, bizzare behavior

I have a ksh script (dtksh Version M-12/28/93d on Solaris 10) that is run daily by cron and sometime hangs forever. I need to detect if there is an old copy hung before I start the new run, and if so send an email and exit the script. Here is part of the code: #!/usr/dt/bin/dtksh... (4 Replies)
Discussion started by: 73rdUserID
4 Replies

5. Shell Programming and Scripting

Awk Script Counting of Correct vs. Error Responses

Hello, I have been trying to use an awk script to parse out correct and incorrect answers in a simple tab-delimited text file. I am trying to compare the user's response to the stimulus presented (in this case, an arrow pointing left or right; e.g., "<--" vs. "-->"). I have the data for the... (6 Replies)
Discussion started by: Jahn
6 Replies

6. Shell Programming and Scripting

[SOLVED] Script error

Hi all I have a code in unix as SCRNAME=`whence $0 | sed -e 's/\.\///g'` this used to return me this path /data/ds/dpr_ebicm_uat/etl/ but i ran this code in linux as SCRNAME=`/bin/ksh whence $0 | sed -e 's/\.\///g'` and now its returning me blank value in SCRNAME. I am not able... (2 Replies)
Discussion started by: vee_789
2 Replies

7. Shell Programming and Scripting

[Solved] Counting specific characters within each field

Hello, I have a file like following: ALB_13554 1 1 1 ALB_13554 1 2 1 ALB_18544 2 0 2 ALB_18544 1 0 1 This is a sample of my file, my real file has 441845 number of fields. What I want to do is to calculate the number of 1 and 2 in each column using AWK, so, the output file looks like... (5 Replies)
Discussion started by: Homa
5 Replies

8. Shell Programming and Scripting

[Solved] Error While Using "Basename" in the Script

Hello All My Requirement is to Delete files in a particular directory based on its extension. So for that i have piece of Code down below horo=`date +%Y%m%d` logfile=/temp/log.file.$horo date >> $logfile for fulldir in 'ls -ld /temp/strs/*' do dir=`basename $fulldir` case $dir in... (3 Replies)
Discussion started by: Ajesh
3 Replies

9. Shell Programming and Scripting

[Solved] Counting The Number of Lines Between Values with Multiple Variables

Hey everyone, I have a bunch of lines with values in field 4 that I am interested in. If these values are between 1 and 3 I want it to count all these values to all be counted together and then have the computer print out LOW and the number of lines with those values in between 1 and 3,... (2 Replies)
Discussion started by: VagabondGold
2 Replies

10. Shell Programming and Scripting

[Solved] Isolating & Counting IP from log file

Dear Community, today my website was under attack for several hours. 2 specific IPs make a tons of "get requests" to a specific page and apache server goes up and down. Now the problem is solved because I put in firewall blacklist these IPs, but I took a lot of time to analyze the apache log to... (6 Replies)
Discussion started by: Lord Spectre
6 Replies
PPERL(1p)						User Contributed Perl Documentation						 PPERL(1p)

NAME
PPerl - Make perl scripts persistent in memory SYNOPSIS
$ pperl foo.pl DESCRIPTION
This program turns ordinary perl scripts into long running daemons, making subsequent executions extremely fast. It forks several processes for each script, allowing many processes to call the script at once. It works a lot like SpeedyCGI, but is written a little differently. I didn't use the SpeedyCGI codebase, because I couldn't get it to compile, and needed something ASAP. The easiest way to use this is to change your shebang line from: #!/usr/bin/perl -w To use pperl instead: #!/usr/bin/pperl -w WARNINGS
Like other persistent environments, this one has problems with things like BEGIN blocks, global variables, etc. So beware, and try checking the mod_perl guide at http://perl.apache.org/guide/ for lots of information that applies to many persistent perl environments. Parameters $ pperl <perl params> -- <pperl params> scriptname <script params> The perl params are sent to the perl binary the first time it is started up. See perlrun for details. The pperl params control how pperl works. Try -h for an overview. The script params are passed to the script on every invocation. The script also gets any current environment variables, the current working directory, and everything on STDIN. Killing In order to kill a currently running PPerl process, use: pperl -- -k <scriptname> You need to make sure the path to the script is the same as when it was invoked. Alternatively look for a .pid file for the script in your tmp directory, and kill (with SIGINT) the process with that PID. ENVIRONMENT
pperl uses the PPERL_TMP_PATH environment variable to determine the directory where to store the files used for inter-process communication. By default, the subdirectory .pperl of the user's home directory is used. BUGS
The process does not reload when the script or modules change. $^S is not represented identically with respect to perl, since your script will be run within an eval block AUTHOR
Matt Sergeant, matt@sergeant.org. Copyright 2001 MessageLabs Ltd. SEE ALSO
perl. perlrun. perl v5.14.2 2011-11-15 PPERL(1p)
All times are GMT -4. The time now is 03:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy