09-10-2012
You store up entire pages in a variable, not passing anything, counting lines, until you see one of the total signatures, then decide on the line count where to write it. At EOF, you need to dispose of the last page from the variable.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (1 Reply)
Discussion started by: shilendrajadon
1 Replies
2. Shell Programming and Scripting
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (2 Replies)
Discussion started by: shilendrajadon
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I've been searching for a quick way to do this with sed, but to no avail.
I have a file containing a long series of (windows) file paths that are separated by the pattern '@'. I would like to extract each file path so that I can later assign a variable to each path.
Here is the file:... (2 Replies)
Discussion started by: nixjennings
2 Replies
4. Shell Programming and Scripting
Need to develop a unix shell script for the below requirement and I need your assistance:
1) search for file.log and file.bad file in a directory and read them
2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file
4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies
5. Shell Programming and Scripting
hi there,
i have a file named 'x20080613_x20100106.pwr1.gc', i want to isolate the part 'x20080613_x20100106' but by using the following line i isolate the part '.pwr1.gc':
`awk '$0=substr($0, length($0)-7)' $temp`
how can i reverse that?
thank you! (3 Replies)
Discussion started by: friend
3 Replies
6. Shell Programming and Scripting
I am looking at using grep to locate the line in the text file and them use awk to select a word or words out of it.
I know awk needs -v to allow a variable to be used, but also needs -F to allow the break up of the sentence and allow the location of separate variables.
$line = grep "1:" File |... (8 Replies)
Discussion started by: Ironguru
8 Replies
7. Shell Programming and Scripting
Hi
my requirement is that i want pull the bad records from input file and move those records in to a seperate file.
that file has to be sent via email..
any suggentions please (1 Reply)
Discussion started by: sxk4999
1 Replies
8. UNIX for Dummies Questions & Answers
I wrote head -n1 example.log I grab the first line of the log, but I need to isolate just the date, which is 08/May/2012:09:52:52. I also need to find the reverse of this, which would be tail...
http://i.imgur.com/Lp1eBD0.png
Thanks in advance (4 Replies)
Discussion started by: spookydll
4 Replies
9. Solaris
Hello,
I have a HP ProLiant DL385 ( X86 ) running Solaris 10 on it.
Our hardware team passwd by server last night and noticed an amber light to indicate a possible bad dimm.
/var/adm/messages, dmesg, prtdiag -v, all shows nothing.
/opt/HPQhealth/sbin/hpasmcli indicated I have a bad... (5 Replies)
Discussion started by: sunnychen98
5 Replies
10. Shell Programming and Scripting
I have a 2 part question on how to this in unix scripting using kshell or c shell.
I have a file described below:
1st record has 2 fields on it
every other record has 22 fields on it.
Example
ABC, email address
Detail 1
Detail 2
Detail 3
.
.
.
1st question is... (4 Replies)
Discussion started by: jclanc8
4 Replies
LEARN ABOUT HPUX
havedisk
rstat(3N) rstat(3N)
NAME
rstat(), havedisk() - get performance data from remote kernel
SYNOPSIS
DESCRIPTION
returns if host has a disk, if it does not, and -1 if this cannot be determined. The host string is either the official name of the host
or an alias for it. See hosts(4) for more information regarding host names.
fills in the statstime structure for host, and returns if it was successful. The relevant structures are:
struct stats { /* RSTATVERS_ORIG */
int cp_time[4]; /* the time spent in each CPU state */
int dk_xfer[4]; /* total number of disk transfers
on each of the disk interfaces */
unsigned v_pgpgin; /* total VM pages paged in */
unsigned v_pgpgout; /* total VM pages paged out */
unsigned v_pswpin; /* total VM pages paged swapped in */
unsigned v_pswpout; /* total VM pages paged swapped out */
unsigned v_intr; /* total interrupts */
int if_ipackets; /* inbound packets on all interfaces */
int if_ierrors; /* inbound errors on all interfaces */
int if_opackets; /* outbound packets on all interfaces */
int if_oerrors; /* outbound errors on all interfaces */
int if_collisions; /* collisions seen on all interfaces */
};
struct statsswtch { /* RSTATVERS_SWTCH */
int cp_time[4]; /* the time spent in each CPU state */
int dk_xfer[4]; /* total number of disk transfers
on each of the disk interfaces */
unsigned v_pgpgin; /* total VM pages paged in */
unsigned v_pgpgout; /* total VM pages paged out */
unsigned v_pswpin; /* total VM pages paged swapped in */
unsigned v_pswpout; /* total VM pages paged swapped out */
unsigned v_intr; /* total interrupts */
int if_ipackets; /* inbound packets on all interfaces */
int if_ierrors; /* inbound errors on all interfaces */
int if_opackets; /* outbound packets on all interfaces */
int if_oerrors; /* outbound errors on all interfaces */
int if_collisions; /* collisions seen on all interfaces */
unsigned v_swtch; /* total context switches */
long avenrun[3]; /* average number of running jobs */
struct timeval boottime; /* time of last boot */
};
struct statstime { /* RSTATVERS_TIME */
int cp_time[4]; /* the time spent in each CPU state */
int dk_xfer[4]; /* total number of disk transfers
on each of the disk interfaces */
unsigned v_pgpgin; /* total VM pages paged in */
unsigned v_pgpgout; /* total VM pages paged out */
unsigned v_pswpin; /* total VM pages paged swapped in */
unsigned v_pswpout; /* total VM pages paged swapped out */
unsigned v_intr; /* total interrupts */
int if_ipackets; /* inbound packets on all interfaces */
int if_ierrors; /* inbound errors on all interfaces */
int if_opackets; /* outbound packets on all interfaces */
int if_oerrors; /* outbound errors on all interfaces */
int if_collisions; /* collisions seen on all interfaces */
unsigned v_swtch; /* total context switches */
long avenrun[3]; /* average number of running jobs */
struct timeval boottime; /* time of last boot */
struct timeval curtime; /* current system time */
};
RPC Info
Program number:
XDR routines:
int xdr_stats(xdrs, stat)
XDR *xdrs;
struct stats *stat;
int xdr_statsswtch(xdrs, stat)
XDR *xdrs;
struct statsswtch *stat;
int xdr_statstime(xdrs, stat)
XDR *xdrs;
struct statstime *stat;
int xdr_timeval(xdrs, tv)
XDR *xdrs;
struct timeval *tv;
Procs:
Takes no arguments, returns long
which is true if remote host has a disk.
Takes no arguments, return struct statsxxx,
depending on version.
Versions:
WARNINGS
User applications that call this routine must be linked with For example,
AUTHOR
was developed by Sun Microsystems, Inc.
SEE ALSO
rup(1), rstatd(1M).
rstat(3N)