02-27-2020
man bash:
Quote:
The exit status is zero, unless end-of-file is encountered,
By setting
-d'', i.e. the delimiter to the "empty string",
read will not stop anywhere but read through to the
EOF string which it interprets as end-of-file and sets
$? to 1.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Can anyone plz share their experience with -
Building shell script to append the file with date in following format-
Filename_MMDDYYYY.txt
Thanks in advance (2 Replies)
Discussion started by: prince_of_focus
2 Replies
2. Infrastructure Monitoring
Hi,
I'm reading net-snmp site, using C language and unix environment, I have manager ( do get/set command), agent and server ... I'm trying to monitor cpu, memory and disk usage and get Ip address of server and send the value back to agent, stored in variable which enable manager to gets the... (1 Reply)
Discussion started by: zainab
1 Replies
3. Shell Programming and Scripting
I have a ksh script that runs a sqlplus script. Every time I run the ksh script it generates a log file like it should and a file called shPID (sh47398.1) with the text of the sql script. Why is it doing this? It is the only ksh script that I have that does this.
thanks. (0 Replies)
Discussion started by: djehresmann
0 Replies
4. Shell Programming and Scripting
Hello,
Can any one please assist how to scirpt it:
Every day a new log file is create and I want to process only the one generated yesterday and get the data of column 3 and 6.
For example today's date is 24 then I want to get the data of log file created on 23rd.
Log Files in... (7 Replies)
Discussion started by: sureshcisco
7 Replies
5. Solaris
Hi All,
New to unix. Here is the problem. Running a script that extracts data from hyperion essbase and generates a file in unix. This script fails most of the times with a very low success rate. The data has increased a lot in the last few months resulting in the file being more than 2 gb.
... (2 Replies)
Discussion started by: noufalshaw
2 Replies
6. UNIX for Advanced & Expert Users
Hi all,
I have root directory on server 1 say A and having sub directory B now my application generates output files and put in sub directory B.
now i need to transfer these files from server1 to server2 by scp which is having same directory structure A and sub directory B
I have tried... (2 Replies)
Discussion started by: tushar_spatil
2 Replies
7. Shell Programming and Scripting
Dear Guru's
I've a requirment to grep for a string in series of log files that are getting generated almost every minute.
I'm looking to schedule a script every 15 mountes,in order to check if the error string has been generated in any of the log files generated in last 15 minutes.
Please... (3 Replies)
Discussion started by: rajivatnova
3 Replies
8. UNIX for Advanced & Expert Users
hello,
can someone please suggest a script to rename a file that was generated today and filename that being generated daily starts with date, its a xml file.
here is example.
# find . -type f -mtime -1
./20130529_4995733057260357019.xml
#
this finename should be renamed to this format.... (6 Replies)
Discussion started by: bobby320
6 Replies
9. Shell Programming and Scripting
Heyas
At home i have 1 nas with 3 shares, of which i used to mount 2 of them using a script with hardcoded password and username in it.
EDIT: Turns out, its not the script, but 'how i access' the nas share.. (-o user=XY,password=... VS. -o credentials=...).
Figured about credential files,... (0 Replies)
Discussion started by: sea
0 Replies
10. Shell Programming and Scripting
Hi All,
I have created a unix script to mail the xls file.This is being done using mailx command
fdate=`tail -1 abc.xls | cut -c1-8`
SUBJECT="CARD GL Exceptions : ${ENV} for ${fdate}"
destname=CARD_GL_Exceptions_$fdate
sed 's/#BUSINESS/BUSINESS/1' abc.xls > abc2.xls
mv abc2.xls abc.xls... (2 Replies)
Discussion started by: karthik adiga
2 Replies
LEARN ABOUT HPUX
fgets_unloc
gets(3S) gets(3S)
NAME
gets(), fgets() - get a string from a stream
SYNOPSIS
Obsolescent Interface
DESCRIPTION
Reads characters from the standard input stream,
into the array pointed to by s, until a new-line character is read or an end-of-file condition is encountered. The new-line
character is discarded and the string is terminated with a null character.
Reads characters from the
stream into the array pointed to by s, until n-1 characters are read, a new-line character is read and transferred to s, or
an end-of-file condition is encountered. The string is then terminated with a null character.
Obsolescent Interface
gets a string from a stream.
APPLICATION USAGE
After or is applied to a stream, the stream becomes byte-oriented (see orientation(5)).
RETURN VALUE
Upon successful completion, and return s. If the stream is at end-of-file, the end-of-file indicator for the stream is set and a null
pointer is returned.
When the file corresponding to an open stream gets extended after the end-of-file is reached, any subsequent calls to these functions will
succeed and the end-of-file indicator will remain set. However, in the UNIX2003 standards environment (see standards(5)), these functions
will return a null pointer and the end-of-file indicator will still remain set.
If a read error occurs, the error indicator for the stream is set, is set to indicate the error, and a null pointer is returned.
and can be used to distinguish between an error condition and an end-of-file condition.
ERRORS
and fail if data needs to be read into the stream's buffer, and:
The flag is set for the file descriptor underlying stream and the process would be delayed in the read operation.
The file descriptor underlying
stream is not a valid file descriptor open for reading.
The read operation was terminated due to the receipt of a signal,
and either no data was transferred or the implementation does not report partial transfer for this file.
The process is a member of a background process
and is attempting to read from its controlling terminal, and either the process is ignoring or blocking the signal or the
process group of the process is orphaned.
Additional values can be set by the underlying function (see read(2)).
WARNINGS
is an obsolescent interface supported only for compatibility with existing DCE applications. New multithreaded applications should use
SEE ALSO
ferror(3S), flockfile(3S), fopen(3S), fread(3S), getc(3S), puts(3S), scanf(3S), orientation(5), standards(5), thread_safety(5), glos-
sary(9).
STANDARDS CONFORMANCE
gets(3S)