Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Reading the output of df command Post 302130323 by Shell_Life on Sunday 5th of August 2007 08:14:37 AM
Old 08-05-2007
Nervous,
The best way to have an explanation of a unix command in a specific system is:
Code:
man command

 

10 More Discussions You Might Find Interesting

1. Programming

Reading console output

I am writing a program that uses system() to pass commands to the command interpreter. Is there a way to read the output that the commands produce? (1 Reply)
Discussion started by: Blaster999
1 Replies

2. Shell Programming and Scripting

reading command output from shell script

Hi List, How to read the output of a command executed from a script. For ex. sample_scritp.sh ------------- useradd testuser1 password testuser1 .... ..... -------------- This prompts for "password", and "confirm password", for which i need to give the values from script. Can... (4 Replies)
Discussion started by: sri b
4 Replies

3. Shell Programming and Scripting

reading ps command's output line by line

hi; as a pseudo; while read psLine do myFunc $psLine done < ps i don't want to redirect ps command's to a file. in fact, my problem is "how can i read stdout line by line in bash, sed, awk or any?" thanks, (5 Replies)
Discussion started by: s. murat
5 Replies

4. 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

5. Shell Programming and Scripting

Reading PL/SQL output online from perl??

Hi there, I got this situation at job. First i have a Perl script that connect to Oracle 10g and execute a package. That package execute severals transactions and must generate log about process status each interval of time. What i'm doing now is saving the plsql package log in an auxiliar... (4 Replies)
Discussion started by: jparra
4 Replies

6. UNIX for Dummies Questions & Answers

Help with reading link output

Hello folks; I have a script uses wget to query a link to get the temperature from sensor then email the results to me. Here's the script: "wget -q http://server/temp -O - | mail -s "Temp Update" moe@ocd.com" normally the output from using wget looks like this: Lab_1|69.8 | ... (8 Replies)
Discussion started by: Katkota
8 Replies

7. UNIX for Dummies Questions & Answers

Reading from Screen/Standard Output

Is it possible to read from the screen or standard output? If so, may I know how I can do this? For example, I have an application running which prints out the following on the screen: Starting tools from .image-tools... imagecontrol_1: SECS/GEM-capable version is running done cindy@pgunix... (2 Replies)
Discussion started by: sippingsoda
2 Replies

8. Shell Programming and Scripting

Error in reading the output from command

I getting error as test1.sh: syntax error at line 3: `do' unexpected while i was trying to run below code.. What was going wrong here? find /usr/tmp/SB/reports/ -type f -name *.rdf |read file;do echo "Copying $file to /usr/tmp/SB1" done (1 Reply)
Discussion started by: millan
1 Replies

9. Shell Programming and Scripting

Reading output returned to OS from java program.

I am writing one shell script in which there is one Java program call. I want to stop execution of shell script ahead of java program if the java program returns 1 . How to read that value of java program from OS ? (3 Replies)
Discussion started by: ParthThakkar
3 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
explain_popen(3)					     Library Functions Manual						  explain_popen(3)

NAME
explain_popen - explain popen(3) errors SYNOPSIS
#include <libexplain/popen.h> const char *explain_popen(const char *command, const char *flags); const char *explain_errno_popen(int errnum, const char *command, const char *flags); void explain_message_popen(char *message, int message_size, const char *command, const char *flags); void explain_message_errno_popen(char *message, int message_size, int errnum, const char *command, const char *flags); DESCRIPTION
These functions may be used to obtain explanations for errors returned by the popen(3) system call. explain_popen const char *explain_popen(const char *command, const char *flags); The explain_popen function is used to obtain an explanation of an error returned by the popen(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: FILE *fp = popen(command, flags); if (!fp) { fprintf(stderr, "%s ", explain_popen(command, flags)); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_popen_or_die(3) function. command The original command, exactly as passed to the popen(3) system call. flags The original flags, exactly as passed to the popen(3) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_errno_popen const char *explain_errno_popen(int errnum, const char *command, const char *flags); The explain_errno_popen function is used to obtain an explanation of an error returned by the popen(3) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: FILE *fp = popen(command, flags); if (!fp) { int err = errno; fprintf(stderr, "%s ", explain_errno_popen(err, command, flags)); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_popen_or_die(3) function. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. command The original command, exactly as passed to the popen(3) system call. flags The original flags, exactly as passed to the popen(3) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_popen void explain_message_popen(char *message, int message_size, const char *command, const char *flags); The explain_message_popen function may be used to obtain an explanation of an error returned by the popen(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: FILE *fp = popen(command, flags); if (!fp) { char message[3000]; explain_message_popen(message, sizeof(message), command, flags); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_popen_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. command The original command, exactly as passed to the popen(3) system call. flags The original flags, exactly as passed to the popen(3) system call. explain_message_errno_popen void explain_message_errno_popen(char *message, int message_size, int errnum, const char *command, const char *flags); The explain_message_errno_popen function may be used to obtain an explanation of an error returned by the popen(3) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: FILE *fp = popen(command, flags); if (!fp) { int err = errno; char message[3000]; explain_message_errno_popen(message, sizeof(message), err, command, flags); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_popen_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. command The original command, exactly as passed to the popen(3) system call. flags The original flags, exactly as passed to the popen(3) system call. SEE ALSO
popen(3) process I/O explain_popen_or_die(3) process I/O and report errors COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_popen(3)
All times are GMT -4. The time now is 10:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy