Your spec seems a bit incomplete, pls add more details:
- how to select / reject the devices (e.g. 172.17.168.227 is missing in your desired output)?
- how to fill items not yet found when encountering the print trigger ("System Name:")?
- why not use "System Description" as the print trigger?
- why <TAB> chars in your desired output, not the commas set as OFS in your script?
Is it possible to get a somewhat more structured data file to analyse?
With what we have got now, how far would this get you:
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
Hello,
I have this awk script that I want to execute by passing parameters through a shell script.
I'm a little confused. This awk script removes duplicates from an input file.
Ok, so I have a .sh file called rem_dups.sh
#!/usr/bin/sh... (4 Replies)
hi everyone
i am trying to do this
bash> cat abc.sh
deepak()
{
echo Deepak
}
deepak
bash>./abc.sh
Deepak
so it is giving me write simply i created a func and it worked
now i modified it like this way
bash> cat abc.sh (2 Replies)
This is the final first release of the dynamic menu generator for pekwm (WM).
#!/bin/bash
function param_val {
awk "/^${1}=/{gsub(/^${1}="'/,""); print; exit}' $2
}
echo "Dynamic {"
for CF in `ls -c1 /usr/share/applications/*.desktop`
do
name=$(param_val Name $CF)
... (3 Replies)
I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks
sh: -c: line 0: syntax error near unexpected token `newline'
sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies
7. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff |... (1 Reply)
Hi
I have a text file (Input.txt) with two column entries separated by tab as given below:
aaa str1
bbb str2
cccccc str3
dddd str4
eee str3
ssss str2
sdf str3
hhh str1
fff str2
ccc str3
.....
.....
..... (1 Reply)
I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the output at the top but sort the rest of the rows alphabetically. This is what I have now but it is... (1 Reply)
Discussion started by: Eric7giants
1 Replies
LEARN ABOUT HPUX
inet6_rth_getaddr
inet6_rth_space(3N)inet6_rth_space(3N)NAME
inet6_rth_add(), inet6_rth_getaddr(), inet6_rth_init(), inet6_rth_reverse(), inet6_rth_segments(), inet6_rth_space() - IPv6 Routing header
options manipulation functions.
SYNOPSIS DESCRIPTION
These functions can be used by an application to build and examine an IPv6 Routing header. The Routing header can be used by an IPv6
source to list one or more intermediate nodes to be visited on the way to a packet's destination.
These three functions build a Routing header: returns the number of bytes required for a Routing header.
initializes the buffer data for a Routing header.
adds one IPv6 address to the Routing header.
Three functions deal with a returned Routing header: reverses a Routing header.
returns the number of segments in a Routing header.
fetches one address from a Routing header.
These functions are described below:
This function returns the number of bytes required to hold a routing
header of the specified type containing the specified number of segments (addresses). For an IPv6 Type 0 Routing header, the number
of segments must be between 0 and 127, inclusive. The return value is just the space for the Routing header. When the application
uses ancillary data, it must pass the returned length to to determine how much memory is needed for the ancillary data object (includ-
ing the structure).
If the return value is 0, then either the type of the Routing header is not supported by this implementation or the number of segments
is invalid for this type of Routing header.
This function returns the size but does not allocate the space required for the ancillary data.
Note: If type is 2 (Routing Header Type 2), segments must be 1 (RFC 4584).
This function initializes the buffer pointed to by
bp to contain a Routing header of the specified type. bp_len is only used to verify if the buffer is large enough.
The caller must allocate the buffer, and its size can be determined by calling
Upon success, the return value is the pointer to the buffer (bp), and the pointer is then used as the first argument to the function.
Upon an error, the return value is NULL.
Note: If type is 2 (Routing Header Type 2), segments must be 1 (RFC 4584).
This function adds the IPv6 address pointed to by
addr to the end of the Routing header being constructed.
If successful, the member of the Routing header is updated to account for the new address in the Routing header and the return value
of the function is 0. Upon an error the return value of the function is -1.
Note: If the Routing header is type 2, this function can only be called once.
This function takes a Routing header extension header pointed to by
the first argument in and writes a new Routing header. The new Routing header sends datagrams along the reverse of that route. The
function reverses the order of the addresses and sets the member in the new routing header to the number of segments. Both arguments
are allowed to point to the same buffer (that is, the reversal can occur in place).
The return value of the function is 0 on success, or -1 upon an error.
Note: If Routing header is type 2, this function returns -1 (RFC 4584).
This function returns the number of segments (addresses) contained in
the Routing header described by bp which can be 0 or greater.
The return value of the function is -1 upon an error.
This function returns a pointer to the IPv6 address specified by
index (which must be a value between 0 and one less than the value returned by in the Routing header described by bp.
An application should first call to obtain the number of segments in the Routing header.
Upon an error, the return value of the function is NULL.
Note: If Routing header is type 2, this function returns a pointer to the IPv6 home address specified by the ip6r2_homeaddr field in
which is pointed by bp. The index must be zero.
Notes
To use these functions, the application must be compiled with:
To receive a Routing header, the application must enable the socket option:
To send a Routing header, the application specifies it either as ancillary data in a call to or using (see send(2) and getsockopt(2),
respectively).
EXAMPLES
gives a comprehensive example in Appendix B.
SEE ALSO send(2), getsockopt(2), IPv6(7P), xopen_networking(7).
inet6_rth_space(3N)