Hi, I've written a shell function in bash that reads letters into an array, then outputs them in one column with:
for n in "${array}"; do
echo $n
done
I was wondering if anyone knew how i would transpose the letters that are output by the for loop. Right now my output is:
aabbcc... (4 Replies)
Hi,
I need to remove all lines from a file that do not start with numbers
For instance, if the first three characters on any line are not numbers, delete those lines
I've tried to do it with awk and it's not working, any ideas ?
Thanks (5 Replies)
I want to add letters A,B,C,… in front of every line of input while printing them out using PERL.
eg
A file is parsed as a cmd line arg and its context will be displayed as
A line1...
B line 2..
I tried this..but I want better and perfect solution!
!perl -p
my $counter;
BEGIN { $counter... (4 Replies)
Hello,
I am working with a perl script that tries to find the average "frequency" in which lines are duplicated. So far I've only managed to find the way to count how many times the lines are repeated, the code is as follows:
perl -ae'
my $filename= $ENV{'i'};
open (FILE, "$filename") or... (10 Replies)
I'm reading in numbers from a file and trying to add them together. Here is the code so far. I know the 1+2+3.... part is wrong. The file has five numbers in it with each number on its own line. The numbers are decimals if that matters. Thanks.
while read EachLine
do
echo $EachLine
done <... (6 Replies)
Hi,
Is there a tool somewhat parallel to rev, but which randomizes instead of reverses?
I've tried rl, but I can only get it to randomize words.
I was hoping for something like this
echo "hello" | ran
leolh
less simpler solutions are also welcome.
Sorry if the question is... (21 Replies)
Hi there,
first of all this is not homework...this is a new type of exercise for practicing vocabulary with my students.
I have a file consisting of two columns, separated by a tab, each line consisting of a word and its definition, separated by a line break.
What i need is to replace a... (15 Replies)
The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1 and output them with the average of $7 in each match. Thank you :).
f1
... (2 Replies)
Discussion started by: cmccabe
2 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)