Sponsored Content
Top Forums Shell Programming and Scripting need script to process ls-l command Post 49764 by Optimus_P on Friday 9th of April 2004 04:37:41 PM
Old 04-09-2004
sinner your missing the point of Tuxs response.

what are you trying to do w/ the ls -l output?
what are your program requirements?
what is your final goal for this project?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script - How to automatically start another process when the previous process ends?

Hi all, I'm doing automation task for my team and I just started to learn unix scripting so please shed some light on how to do this: 1) I have 2 sets of datafiles - datafile A and B. These datafiles must be loaded subsequently and cannot be loaded concurrently. 2) So I loaded datafile A... (10 Replies)
Discussion started by: luna_soleil
10 Replies

2. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

3. Shell Programming and Scripting

Perl script to kill the process ID of a command after a certain period

All, I am trying to build a script in perl that will alllow me to pass the IP address to a ping command and redirect the output to a file and then kill that process after a certain period of time. let's say, I call my script ping.pl, I would like to be able to run it like this for example :... (7 Replies)
Discussion started by: Pouchie1
7 Replies

4. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

5. Shell Programming and Scripting

Process diff command output in a shell script

diff -yta file1 file2 #!/usr/abc/b/bin/perl5.6 | #!/usr/abc/b/bin/perl5.8 Notable thing about above line is "|" appears at 62nd position. When the same line is assigned in a variable in a ksh script, using ss=$(diff -yta file1 file2) it appears as ... (4 Replies)
Discussion started by: bhaliyajalpesh
4 Replies

6. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

7. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

8. Shell Programming and Scripting

script to get child process for a process

!/bin/sh pid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $1}') sid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $3}') ps -s "$sid" I am not able to get the desired output it says process list error if i use watch ps -s "$sid" it considers only the first session id (5 Replies)
Discussion started by: schippada
5 Replies

9. AIX

Command or script to inform server owner about process

Hi all, How to inform server owner if the particular process is down. I need command or script to do the above. TIA (3 Replies)
Discussion started by: sumanthupar
3 Replies

10. Shell Programming and Scripting

Command to get exact tomcat process I am running ignoring other java process

Team, I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list. How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Discussion started by: Ghanshyam Ratho
4 Replies
RPMATCH(3)						     Linux Programmer's Manual							RPMATCH(3)

NAME
rpmatch - determine if the answer to a question is affirmative or negative SYNOPSIS
#include <stdlib.h> int rpmatch(const char *response); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): rpmatch(): _SVID_SOURCE DESCRIPTION
rpmatch() handles a user response to yes or no questions, with support for internationalization. response should be a null-terminated string containing a user-supplied response, perhaps obtained with fgets(3) or getline(3). The user's language preference is taken into account per the environment variables LANG, LC_MESSAGES, and LC_ALL, if the program has called setlocale(3) to effect their changes. Regardless of the locale, responses matching ^[Yy] are always accepted as affirmative, and those matching ^[Nn] are always accepted as neg- ative. RETURN VALUE
After examining response, rpmatch() returns 0 for a recognized negative response ("no"), 1 for a recognized positive response ("yes"), and -1 when the value of response is unrecognized. ERRORS
A return value of -1 may indicate either an invalid input, or some other error. It is incorrect to only test if the return value is nonzero. rpmatch() can fail for any of the reasons that regcomp(3) or regexec(3) can fail; the cause of the error is not available from errno or anywhere else, but indicates a failure of the regex engine (but this case is indistinguishable from that of an unrecognized value of response). CONFORMING TO
rpmatch() is not required by any standard, but is available on a few other systems. BUGS
The rpmatch() implementation looks at only the first character of response. As a consequence, "nyes" returns 0, and "ynever; not in a mil- lion years" returns 1. It would be preferable to accept input strings much more strictly, for example (using the extended regular expres- sion notation described in regex(7)): ^([yY]|yes|YES)$ and ^([nN]|no|NO)$. EXAMPLE
The following program displays the results when rpmatch() is applied to the string given in the program's command-line argument. #define _SVID_SOURCE #include <locale.h> #include <stdlib.h> #include <string.h> #include <stdio.h> int main(int argc, char *argv[]) { if (argc != 2 || strcmp(argv[1], "--help") == 0) { fprintf(stderr, "%s response ", argv[0]); exit(EXIT_FAILURE); } setlocale(LC_ALL, ""); printf("rpmatch() returns: %d ", rpmatch(argv[1])); exit(EXIT_SUCCESS); } SEE ALSO
fgets(3), getline(3), nl_langinfo(3), regcomp(3), setlocale(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2007-07-26 RPMATCH(3)
All times are GMT -4. The time now is 11:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy