Beauty is in the eye of the beholder. I like my lines to stay lines, so I never looked for a replacement for '\
'. Often, in C/C++, I put strings in one line per, like:
hi,
I have this script which gives me the result...
#! /usr/bin/sh
set -x
cd /home/managar
a=1
while true
do
if
then
echo " File log.txt exists in this directory "
exit 0
fi
echo " File has not arrived yes..."
sleep 3
let a=a+1
if
then (1 Reply)
I have written a shell script which looks like below:
grep -v ',0,' ./DATA/abc.001 > ./DATA/abc.mid
egrep $GREPSEARCH ./DATA/ebc.mid > ./DATA/abc.cut
the variable GREPSEARCH has values like the below:
... (3 Replies)
Hi,
I have a script in which an entry like this .....
FILENAME_B="PIC_${DATE}0732*.JPG"
The script connects to an ATM and pull a pic file from it.The format for the file is like PIC_2008061400000001.JPG in the ATM.
Means 1st 8 digit is the date(YYYYMMDD) field
2nd 8 digit means hrs... (2 Replies)
Hi all
Here I came accross a situation which i am unable to reason out...
snippet 1
psg ServTest | grep -v "grep" | grep -v "vi" | awk '{
pgm_name=$8
cmd_name="ServTest"
gsub(/]*/,"",pgm_name)
if(pgm_name==cmd_name) { print "ServTest Present =" cmd_name}
}'... (10 Replies)
Hi All
I have a flat text file. Each line in it contains a "/full path/filename". The last three columns are predictable, but directory depth of each line varies.
I want to sort on the last three columns, starting from the last, 2nd last and 3rd last. In that order. The last three columns... (6 Replies)
Hi,
I am using HP-UX B.11.23 U ia64
I am trying to retrieve files using -mtime option of find command
However I found that -mtime is not giving correct results
Following is the output of commands executed on 03-Dec-2009
It can be seen that -mtime +1 should have returned all... (2 Replies)
Hello,
I am writing a small one liner script to display the tables in my database.
I am working with Centos 5.5 and postgresql
the command is
"psql -c "\dt" | awk '{print$3}'"
I just want the 3rd column from the result set, but now the problem is I am getting the third column but with... (3 Replies)
Version: RHEL 5.8
I am doing a grep of the piped output from ps command as shown below.
I am grepping for the pattern ora_dbw* . But, in the result set I am seeing strings with ora_dbr* as well like ora_dbrm_SDLM1DAS3 as shown below. Any idea why is this happening ?
$ ps -ef | grep... (6 Replies)
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
Hi
I am comparing two files with comm -13 < (sort acc11.txt) < (sort acc12.txt) > output.txt
purpose: Get non matching records which are in acc12 but not in acc11...
TI am getting WRONG output.
Is there any constraints with record length with comm? The above files are the two consective ... (2 Replies)
Discussion started by: vedanta
2 Replies
LEARN ABOUT DEBIAN
explain_fputs_or_die
explain_fputs_or_die(3) Library Functions Manual explain_fputs_or_die(3)NAME
explain_fputs_or_die - write a string to a stream and report errors
SYNOPSIS
#include <libexplain/fputs.h>
void explain_fputs_or_die(const char *s, FILE *fp);
int explain_fputs_on_error(const char *s, FILE *fp);
DESCRIPTION
The explain_fputs_or_die function is used to call the fputs(3) system call. On failure an explanation will be printed to stderr, obtained
from the explain_fputs(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_fputs_on_error function is used to call the fputs(3) system call. On failure an explanation will be printed to stderr, obtained
from the explain_fputs(3) function, but still returns to the caller.
s The s, exactly as to be passed to the fputs(3) system call.
fp The fp, exactly as to be passed to the fputs(3) system call.
RETURN VALUE
The explain_fputs_or_die function only returns on success, see fputs(3) for more information. On failure, prints an explanation and exits,
it does not return.
The explain_fputs_on_error function always returns the value return by the wrapped fputs(3) system call.
EXAMPLE
The explain_fputs_or_die function is intended to be used in a fashion similar to the following example:
explain_fputs_or_die(s, fp);
SEE ALSO fputs(3)
write a string to a stream
explain_fputs(3)
explain fputs(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_fputs_or_die(3)