Sponsored Content
Full Discussion: Version checking
Top Forums Shell Programming and Scripting Version checking Post 303022744 by indeed_1 on Thursday 6th of September 2018 05:30:40 AM
Old 09-06-2018
thank you this part run correctly and output are exact address. when i echo "$args" print address "/home/config", but part two not work correctly!

Code:
#!/bin/sh
cnt=0
ps -eo args |
while read prog tmp args
do
type=""
  case $prog in
  (*app);;
  (*)
    continue;;
  esac
 ver=$("$prog" -version </dev/null)


but this part not run and give me this error : ./script.sh: line 14: readconfig: command not found

Code:
readconfig < $args
readconfig(){
  # set state, hostname, ip
  while IFS=" =" read confkey confval
  do
    case $confkey in
    ([Ss]tate) state=$confval;;
    ([Hh]ostname) host=$confval;;
    ([Ii]p) ip=$confval;;
    esac
  done
}

echo $confkey $confval $state $hostname $ip

 

9 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

checking of GNU C Complier version

Hi, How do i check the GNU C Complier my system is running? thanks jennifer (2 Replies)
Discussion started by: jennifer
2 Replies

2. UNIX for Dummies Questions & Answers

checking for non-zero value

I have a process that spits out a file called sqlplus.out, here is what the result looks like: Currently the value you see is zero, what I need to do is perform an action if that value is non-zero, so how do I check that value in an if statement? If it helps at this moment in development the... (6 Replies)
Discussion started by: philplasma
6 Replies

3. AIX

checking the version revisions of a java file inside the ear using KSHELL in AIX.

consider on day1, in PVCS repository we have java files like a.java,b.java with version revision 1.0, through ANT build script we have compiled and created an ear,named c.ear in AIX build server.we have transfered this ear from build server to portal server through FTP using KSHELL. consider... (0 Replies)
Discussion started by: kareemaashik
0 Replies

4. Solaris

Migrate unix version 8 to version 9

i have a program writing in PRO C which currently running in unix version 8 tie with oracle 8i, but in the future company gonna migrate this OS to version 9. Anything i have to prepare for my PRO C program to run in unix version 9? or anything would that impact my program couldn't run well? what... (2 Replies)
Discussion started by: lsy
2 Replies

5. UNIX for Advanced & Expert Users

Advanced Search * View * Edit JAVA version to WORK in GLASSFISH Forum topic JAVA version

Would like to confirm the ff. I got confused actually with the version I needed to download that will work on glassfish 3.0.1 a. Debian Squeeze (HP DL360). Need to use java version6 On Debian, I did apt-get install sun-java6-jdk. So when I check it's java version "1.6.0_22" Java(TM) SE... (1 Reply)
Discussion started by: lhareigh890
1 Replies

6. SCO

Stop boot system at "Checking protected password and checking subsystem databases"

Hi, (i'm sorry for my english) I'm a problem on boot sco unix 5.0.5 open server. this stop at "Checking protected password and checking subsystem databases" (See this image ) I'm try this: 1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094 2) SCO: SCO Unix - Server hangs... (9 Replies)
Discussion started by: buji
9 Replies

7. Shell Programming and Scripting

Copy a file from directroy/ prior version to the directory/ new version

How to copy a file from directroy/ prior version to the directory/ new version automatically. (4 Replies)
Discussion started by: roy1912
4 Replies

8. AIX

Checking xlc compiler version

Hi, Below is output of lslpp command. bash-3.00# lslpp -L | grep xlC xlC.aix50.rte 11.1.0.1 C F XL C/C++ Runtime for AIX 5.3 xlC.cpp 9.0.0.0 C F C for AIX Preprocessor xlC.msg.en_US.cpp 9.0.0.0 C F C for AIX... (2 Replies)
Discussion started by: manoj.solaris
2 Replies

9. Red Hat

OS version and Firmware version

Guys, How to find OS version and firmware version in LINUX? Like in AIX. uname -a will show me the version 5.3, 6.1,7.1. lsmcode -c will show me - system firmware image as SF240_417. What are the similar commands in Linux. I checked uname -a and cat /etc/release. uname... (1 Reply)
Discussion started by: ElizabethPJ
1 Replies
tryto(1)						      General Commands Manual							  tryto(1)

NAME
tryto - tries to run a command limited by a timeout or number of tries, can be used to run as svlogd(8) processor. SYNOPSIS
tryto [-pPv] [-t sec] [-k ksec] [-n tries] prog DESCRIPTION
prog consist of one or more arguments. tryto runs and watches prog, feeding its standard input to prog's standard input. If prog exits with a return code other then 0, tryto runs prog again after sleeping one second. If the number of retries reaches the maximal number of tries, tryto prints an error message and gives up. If the timeout sec seconds is reached and prog is still running, tryto sends a TERM signal to prog, waits ksec seconds for prog to termi- nate, then sends a KILL signal if prog still is there, and exits as soon as possible. OPTIONS
-t sec timeout. Set the timeout to send TERM to prog to sec seconds. Default is 180. -k ksec kill timeout. Set the timeout to send KILL to prog to ksec seconds. Default is 5. -n tries Set the maximal number of tries to tries. If prog exited with a return code other that 0, tryto tries to rewind standard input to the beginning using lseek(2) before starting prog again. Default is 5. -p processor. Use this option if you run tryto as a svlogd(8) processor (see below). -P process group. Run prog in a new session and process group, and send signals on timeout to prog's process group instead of its pid. -v verbose. Print verbose messages to standard error. PROCESSOR
If tryto sees the -p option, tryto runs as a svlogd(8) or multilog(8) processor, making use of filedescriptors 4 and 5: Before starting prog, tryto moves the filedescriptor 5 to 2, so all error messages from tryto and prog will be saved in svlogd(8)'s state to be processed on the next run of tryto -p. After starting prog, tryto first feeds all data it reads from filedescriptor 4 into prog's standard input, then all data from filedescrip- tor 0. If prog fails by timeout sec seconds or maximal number of tries, tryto prints all data from standard input to standard output, an error message to standard error, and exits with 0. EXIT CODES
If tryto itself fails, it returns 111. If tryto runs as a svlogd(8) processor, tryto returns 0 in all other cases. If prog was run successfully, tryto returns 0. If prog failed by timeout, tryto returns 100. If prog failed by maximal number of tries, tryto returns the last return code from prog. SEE ALSO
socklog(8), uncat(1), svlogd(8), multilog(8), lseek(2) http://smarden.org/socklog/ http://smarden.org/runit/ AUTHOR
Gerrit Pape <pape@smarden.org> tryto(1)
All times are GMT -4. The time now is 04:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy