Sponsored Content
Top Forums Shell Programming and Scripting Finding PID of a process using variable substituition Post 302296947 by amio on Thursday 12th of March 2009 07:44:40 AM
Old 03-12-2009
Thanks friends for ur replies.

amio.
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

finding out the pid for a busy text file

Can some one please tell me how to find out the proccess ID that is holding up a file. I am attempting to remove a file and I am getting a message stating that it is busy. i.e rm filename filename: 777 mode ? (y/n) y rm: filename not removed. Text file busy Thanks in advance. (1 Reply)
Discussion started by: jxh461
1 Replies

2. Solaris

getting pid of process

hi all, Is there a simple script anyone could through out to me, to find the pid of a process given the name. I actually need to bind this pid to a processor set. I would probably put these comamns in a shell script which would have. a) kick start the executable b) get the pid c) bind it to a... (10 Replies)
Discussion started by: Naanu
10 Replies

3. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

4. Shell Programming and Scripting

Get an PID of particular process

Hi I have written a shell script to find and kill the particular process. Here in shell script i have written the code like cnt = $(ps -ef | grep Shree) echo $cnt I am getting the output root 2326 2317 0 14:39:46 pts/1 0:28 Shree -f fdc.fbconf FDCapp.fbapp Here I want to... (2 Replies)
Discussion started by: Shreedhar Naik
2 Replies

5. Shell Programming and Scripting

Finding the nice(ni) number with PID?

Hi, is there a command that takes the PID of a process and that only diplays it's ni number? I`m pretty sure it would require pipes but I tried a few things that ended up miserably... Since the ps command doesn't show the ni unless I do ps -o ni but then I can't find a way to search the right... (2 Replies)
Discussion started by: Yakuzan
2 Replies

6. Solaris

Finding PID of Killing process

Say I have 2 processes(perl scripts on Solaris machine) A and B. the process A kill the process B. While in the process B how do I print the PID of the process that Killed it(process A) before dieing. My process A looks like open(STATS, "ps -ef|"); while ($inputLine = <STATS>) { if... (7 Replies)
Discussion started by: enigma_007
7 Replies

7. Shell Programming and Scripting

Get PID of a process into a variable

Hi All, I need to get the PID of a process which i ran in background into a variable echo $! gives me the PID of last background process but how to get this into a variable so that i can use "wait" command later in the script to make sure that this background process was done var = `echo... (5 Replies)
Discussion started by: firestar
5 Replies

8. Shell Programming and Scripting

Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Discussion started by: Bolanok
2 Replies

9. Shell Programming and Scripting

Error in finding the PID by grep and assigning to a variable

Hello All, I am facing difficulty in getting the PID value & then assigning it to a variable, kindly help me in resolving the issue. Thanks a lot in advance. The custom utility used inside the Test2.sh will process the file in a batch of 10 lines at once and for efficient memory management,... (3 Replies)
Discussion started by: duddukuri
3 Replies

10. Shell Programming and Scripting

Help with finding the exit status of a 'nohup' command using 'PID'.

Hello All, I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command. 1.The fifty scripts are stored in a separate file. 2.In a master script, i'm reading every line of the file through loop and executing... (4 Replies)
Discussion started by: SriRamKrish
4 Replies
MAXDB_FIELD_COUNT(3)							 1						      MAXDB_FIELD_COUNT(3)

maxdb_field_count - Returns the number of columns for the most recent query

       Procedural style

SYNOPSIS
int maxdb_field_count (resource $link) DESCRIPTION
Object oriented style int maxdb::field_count (void ) Returns the number of columns for the most recent query on the connection represented by the $link parameter. This function can be useful when using the maxdb_store_result(3) function to determine if the query should have produced a non-empty result set or not without knowing the nature of the query. RETURN VALUES
An integer representing the number of fields in a result set. EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); maxdb_report (MAXDB_REPORT_OFF); $maxdb->query("DROP TABLE friends"); maxdb_report (MAXDB_REPORT_ERROR); $maxdb->query( "CREATE TABLE friends (id int, name varchar(20))"); $maxdb->query( "INSERT INTO friends VALUES (1,'Hartmut')"); $maxdb->query( "INSERT INTO friends VALUES (2, 'Ulf')"); if ($maxdb->field_count()) { /* this was a select/show or describe query */ $result = $maxdb->store_result(); /* process resultset */ $row = $result->fetch_row(); /* free resultset */ $result->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); maxdb_report (MAXDB_REPORT_OFF); maxdb_query($link,"DROP TABLE friends"); maxdb_report (MAXDB_REPORT_ERROR); maxdb_query($link, "CREATE TABLE friends (id int, name varchar(20))"); maxdb_query($link, "INSERT INTO friends VALUES (1,'Hartmut')"); maxdb_query($link, "INSERT INTO friends VALUES (2, 'Ulf')"); if (maxdb_field_count($link)) { /* this was a select/show or describe query */ $result = maxdb_store_result($link); /* process resultset */ $row = maxdb_fetch_row($result); /* free resultset */ maxdb_free_result($result); } /* close connection */ maxdb_close($link); ?> The above example produces no output. PHP Documentation Group MAXDB_FIELD_COUNT(3)
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy