Hi,
From the above output of df command I need to parse only 43G (available space) and display it.
root@localhost:> df -h /vol1/joy
Filesystem Size Used Avail Capacity Mounted on
/vol1/joy 180G 137G 43G 76% ... (3 Replies)
hello,
I want to print my output into a file inside of awk, but I don't know it could wokr with using system (piping the $1-4 to another shellskript):
cat file.txt |awk '{ if ($5==2) {dataname=$1 "_" $2 "_" $3 "_" $4 "_typing.rad"
befehl=".gen_test " $7 " " $8 " " $8
system(befehl) >... (5 Replies)
Hi, im in need if wisdom here guys...
How could I store the output of commands like ping integrally directly into a array??? I'll be using system() to run the commands but how can I send the output to an array??? cuz I need to store it so that I can later copy the array's content to a buffer... (5 Replies)
Hi there
could anybody point me in the right direction when it comes to looping through the output of a system command in perl (i.e. df -k) doing a test against each line to see if it matches?
for example if i have a df -k output like this and I wanted to grab the lines that matched "sda" or... (3 Replies)
Hi,
I am new to C and have a little problem.
I am not planning to be a C expert, but this would be nice to understand.
The problem is that a 'system' call prints it output to stdout, when I do not expect this.
This is the program:
trial.c
#include <ctype.h>
#include <unistd.h>... (5 Replies)
Hi everybody,
I am working on a bigger awk script in which one part is comparing the size of two files.
I want to evaluate which file is bigger and then just save the bigger one.
I got it all working except for the part where I want to figure out which file is bigger; the one awk is currently... (2 Replies)
hey guys in only new to scripting as such, but i have a problem.
i want to take the output of a search i do in the command line to then be in a variable but only a certain part of the output.
this this what im doing:
-bash-2.05b$ ldapsearch -x '(dn:=dc)' dc|grep dc=
# base... (1 Reply)
Hi
we are calling kill -9 $pid command from bash script it gives below output, but we need to hide the output. i tried /dev/null but ni luck. is there any alternate way to schive this.
../kill_scr.sh: line 42: 1891 Killed /tmp/anr_rest_mul_wc.sh
Soalris 10.
... (2 Replies)
Hi Guys,
Please help me.. it is urgent. I am writing a perl script to capture command output and redirect it to a logfile.At the same i want to check the return code of the command and log it if the command is not succesful in my logfile.. Here is my code, it is working but system command inside... (2 Replies)
How to capture system() function output in awk variable and the print that awk variable..... (8 Replies)
Discussion started by: bharat1211
8 Replies
LEARN ABOUT OSF1
pclose
pclose(3) Library Functions Manual pclose(3)NAME
pclose - Closes a pipe to a process
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <stdio.h>
int pclose (
FILE *stream );
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
pclose(): XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to a FILE structure for an open pipe returned by a previous call to the popen() function.
DESCRIPTION
The pclose() function closes a pipe between the calling program and a shell command to be executed. Use the pclose() function to close any
stream you have opened with the popen() function. The pclose() function waits for the associated process to end, and then returns the exit
status of the command. If the original processes and the process started with the popen() function concurrently read or write a common
file, neither should use buffered I/O. If they do, the results are unpredictable.
RETURN VALUES
Upon successful completion, the pclose() function returns the exit status of the command.
If an error is detected, pclose() sets errno to an appropriate value and returns a value of -1.
ERRORS
If the pclose() function fails, errno may be set to the following value: The status of the child process could not be obtained.
RELATED INFORMATION
Functions: fclose(3), popen(3), wait(2)
Standards: standards(5) delim off
pclose(3)