Sponsored Content
Top Forums Shell Programming and Scripting Get Pid from a command output Post 302446824 by konsolebox on Thursday 19th of August 2010 09:55:20 PM
Old 08-19-2010
Try this one:
Code:
BINARIES=()
while read LINE; do
    BINARIES[${#BINARIES[@]}]=$LINE
done < <(sed -n '/^execname = /s/^execname = //p' apps.conf)

Code:
IFS=$'\n'
BINARIES=($(sed -n '/^execname = /s/^execname = //p' apps.conf))

bash 4.0
Code:
readarray -t BINARIES < <(sed -n '/^execname = /s/^execname = //p' apps.conf)


Last edited by konsolebox; 08-19-2010 at 11:20 PM.. Reason: forgot to specify the file
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

2. UNIX for Advanced & Expert Users

To get PID of a command passed to a secondary system

Hi Reqmt: I am working on Sys 1 and passes a command to Sys2 using a utility which has ssh coded in it. Is there any way to get the process id of the command in Sys 2 from my Sys1 ? Note: The utility is not editable, so you cannot get it through it and I am not logged in in Sys2. Thanks... (2 Replies)
Discussion started by: anu_math9
2 Replies

3. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

4. Shell Programming and Scripting

Output of ps + awk in a variable to get PID

Hi All, I am getting the PID of a process using its name using the following command in a script mypid=`ps aux | awk '/test5/ && !/awk/ { print $2 }'` echo PID is $mypid The problem is the PID is not getting printed. But when i run the command directly in shell, the PID got printed. ... (2 Replies)
Discussion started by: amio
2 Replies

5. Shell Programming and Scripting

output nohup file containg the PID

Hi to everybody. Is it possible to nohup a process and redirect the output to a file containing the PID? E.g. if nohup filename > out.nohup associate the PID=8074 to filename, is it possible to call the output file something like out_8074.nohup instead of out.nohup? By this way it would... (0 Replies)
Discussion started by: plsrn
0 Replies

6. AIX

kill -3 <PID> ... where the output file goes?

Hi all, I am generating the coredump of my JBoss, and by default it puts it in to a particular directory. i.e. JBOSS_HOME/. I would like this output file to be created, lets say in /tmp/dump/. I tried the following: kill -3 9404940>/tmp/dump/out.txt But it created... (3 Replies)
Discussion started by: haroon_a
3 Replies

7. UNIX for Dummies Questions & Answers

UNIX command to get inode's tid and pid

Hi everyone, I am new here in www.unix.com, i found this site because I am looking for an answer to this problem of mine. I need to know a UNIX command to display an inode's thread id and process id. Hope someone can help me on this. Thanks :D (8 Replies)
Discussion started by: rodkun
8 Replies

8. UNIX for Dummies Questions & Answers

Determine uniqueness of pid to name output files

Hi, We've a process on AIX UNIX server which is executed by multiple uses during a day. I wish to create a log file for every time the process is executed. I wish to know how unique are PID(s) on AIX UNIX servers if I were to name the log files with <date> and <PID>? E.g. If I create my... (1 Reply)
Discussion started by: vkumbhakarna
1 Replies

9. Shell Programming and Scripting

How to find the corresponding command for a existing PID?

Hi All, A process completed already and I have the PID. I want to know the which command used for this PID. 'ps' command and '/proc' folder having the list current process only. Is there a way to search completed process PID? Thanks, Manimuthu (5 Replies)
Discussion started by: k_manimuthu
5 Replies

10. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies
BACON(1)							       bacon								  BACON(1)

NAME
bacon - small RSpec clone SYNOPSIS
bacon [options] [files | -a] [-- untouched arguments] DESCRIPTION
Ruby options: -e, --eval LINE evaluate a LINE of code -d, --debug set debugging flags (set $DEBUG to true) -w, --warn turn warnings on for your script -I, --include PATH specify $LOAD_PATH (may be used more than once) -r, --require LIBRARY require the library, before executing your script bacon options: -s, --specdox do AgileDox-like output (default) -q, --quiet do Test::Unit-like non-verbose output -p, --tap do TAP (Test Anything Protocol) output -k, --knock do Knock output -o, --output FORMAT do FORMAT (SpecDox/TestUnit/Tap) output -Q, --no-backtrace don't print backtraces -a, --automatic gather tests from ./test/, include ./lib/ -n, --name NAME runs tests matching regexp NAME -t, --testcase TESTCASE runs tests in TestCases matching regexp TESTCASE Common options: -h, --help Show this message --version Show version bacon 1.1.0 July 2011 BACON(1)
All times are GMT -4. The time now is 06:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy