hi all i am trying to save an awk value into an array in bash:
total=`awk '{sum+=$3} END {print sum}' "$count".txt"`
((count++))
the above statement is in a while loop..
$count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.)
i get the following error:
./lines1:... (1 Reply)
Hello,
I have a shell script containing a command string in the following format:
command1 | command2 | cut -c9-16
The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234
I wish to save this value to a variable for use in later commands... (4 Replies)
Hi All,
I am trying to convert the below Csh code into Perl.
But i have the following error.
Can any expert help ?
Error:
ls: *tac: No such file or directory
Csh
set $ST_file = `ls -rt *$testid*st*|tail -1`;
Perl
my $ST_file = `ls -rt *$testid*st*|tail -1`; (10 Replies)
Hello,
I am writing a ksh script on an AIX system. I need to get the date and time from a file into a variable. I found the following perl script from another post on this site and modified it slightly to output the format I need:
perl -e '@d=localtime ((stat(shift)));... (4 Replies)
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
hi i want to find the size of a folder and assign it to a variable and then compare if it is greater than 1 gb.
i am doin this script, but it is throwing error....
#!/bin/ksh
cd . | du -s | size = awk '{print $1}'
if size >= 112000
then
echo size high
fi
ERROR : (4 Replies)
Hi, guys, i have a script i inherited from a coworker but i'm not perl savy. The script works but i would like it to work better. I want to run this command
./ciscomgrtest.pl -r "show version" -h hosts.router
and have the script goto each router in the hosts.router file and run the command... (2 Replies)
Hi Experts,
I am trying to get system output to capture inside awk , but not working:
Please advise if this is possible :
I am trying something like this but not working, the output is coming wrong:
echo "" | awk '{d=system ("date") ; print "Current date is:" , d }'
Thanks, (5 Replies)
So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Hi,
I am trying to use variable output in awk to append a string to a word in a line. But that is not happening. Could you please help me on this.
YouTube Video Tutorial: How to Use Code Tags and Format Posts @UNIX.com
The below is the code
#!/bin/ksh
set -x
src=/users/oracle/Temp... (2 Replies)
Discussion started by: pvmanikandan
2 Replies
LEARN ABOUT PHP
scsi_address
scsi_address(9S) Data Structures for Drivers scsi_address(9S)NAME
scsi_address - SCSI address structure
SYNOPSIS
#include <sys/scsi/scsi.h>
INTERFACE LEVEL
Solaris architecture specific (Solaris DDI)
DESCRIPTION
A scsi_address structure defines the addressing components for a SCSI target device. The address of the target device is separated into two
components: target number and logical unit number. The two addressing components are used to uniquely identify any type of SCSI device;
however, most devices can be addressed with the target component of the address.
In the case where only the target component is used to address the device, the logical unit should be set to 0. If the SCSI target device
supports logical units, then the HBA must interpret the logical units field of the data structure.
The pkt_address member of a scsi_pkt(9S) is initialized by scsi_init_pkt(9F).
STRUCTURE MEMBERS
scsi_hba_tran_t *a_hba_tran; /* Transport vectors for the SCSI bus */
ushort_t a_target; /* SCSI target id */
uchar_t a_lun; /* SCSI logical unit */
a_hba_tran is a pointer to the controlling HBA's transport vector structure. The SCSA interface uses this field to pass any transport
requests from the SCSI target device drivers to the HBA driver.
a_target is the target component of the SCSI address.
a_lun is the logical unit component of the SCSI address. The logical unit is used to further distinguish a SCSI target device that supports
multiple logical units from one that does not. The makecom(9F) family of functions use the a_lun field to set the logical unit field in the
SCSI CDB, for compatibility with SCSI-1.
SEE ALSO makecom(9F), scsi_init_pkt(9F), scsi_hba_tran(9S), scsi_pkt(9S)
Writing Device Drivers
SunOS 5.10 30 Aug 1995 scsi_address(9S)