12-05-2007
Got this option as well:
lanscan | awk '/[0-9]/{print $3, $2}' | while read i
do
echo linkloop -i $i
echo "----------------------"
linkloop -i $i
echo
done
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies
2. Shell Programming and Scripting
Hi Experts,
I am adding a column of numbers with awk , however not getting correct output:
# awk '{sum+=$1} END {print sum}' datafile
2.15291e+06
How can I getthe output like : 2152910
Thank you..
# awk '{sum+=$1} END {print sum}' datafile
2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies
3. Shell Programming and Scripting
I want to filter 2nd column = 2 using awk
$ cat t
1 2
2 4
$ VAR=2
#variable worked in print
$ cat t | awk -v ID=$VAR ' { print ID}'
2
2
# but variable didn't work in awk filter
$ cat t | awk -v ID=$VAR '$2~/ID/ { print $0}' (2 Replies)
Discussion started by: honglus
2 Replies
4. Shell Programming and Scripting
Hi
I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it
The code is that:
{
if (NF==17){
print $0
}else{
fields=NF;
all=$0;
while... (2 Replies)
Discussion started by: fate
2 Replies
5. Shell Programming and Scripting
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies
6. Shell Programming and Scripting
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies
7. Shell Programming and Scripting
Using ksh to call a function which has awk script embedded.
It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies
8. Shell Programming and Scripting
consider the script below
sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml
awk -F'' '{for(i=1;i<=NF;i++){
if($i=="Alert id") {
if(id!="")
if(dt!=""){
cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies
9. Shell Programming and Scripting
Hi,
I am trying to pass awk field to a command line executed within awk (need to convert a timestamp into formatted date).
All my attempts failed this far.
Here's an example.
It works fine with timestamp hard-codded into the command
echo "1381653229 something" |awk 'BEGIN{cmd="date -d... (4 Replies)
Discussion started by: tuxer
4 Replies
10. Shell Programming and Scripting
Good evening, Im newbie at unix specially with awk
From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example
1.
This is the inputfile:
$ more MapaRep.txt
ds_extra_nikira_usuarios... (18 Replies)
Discussion started by: alexcol
18 Replies
LEARN ABOUT HPUX
cmscancl
cmscancl(1m) cmscancl(1m)
NAME
cmscancl - gather system configuration information from nodes with Serviceguard installed.
SYNOPSIS
cmscancl [-n node_name]... [-s|-o output_file]
DESCRIPTION
cmscancl is a configuration report and diagnostic tool intended only for use by HP Support Personnel. It gathers system software and hard-
ware configuration information from a list of nodes, or from all the nodes in a cluster. The information that this command displays
includes LAN device configuration, network status and interfaces, file systems, LVM configuration, link-level connectivity (HPUX only),
IPv4/IPv6 connectivity, and the data from the binary cluster configuration file. This command can be used as a troubleshooting tool or as
a data collection tool.
This command is a Perl script which gathers system configuration information by executing various OS commands or tools. It uses the cmexec
command to gather information from remote nodes.
The -n option can be used to specify a list of nodes to be scanned, the nodes to be scanned do not need to be a member of a cluster. If
the -n option is not specified, it will scan all the nodes in the local cluster.
By default, the output of this command will go to the file /tmp/scancl.out. If the file /tmp/scancl.out already exists, the old file will
be saved in /tmp/scancl.out.old.
The -o option can be used to redirect output to a specified output file. If the -o option is not specified, output will go to the default
output file /tmp/scancl.out.
The -s option can be used to direct all output to the screen, instead of to an output file.
Options
cmscancl supports the following options:
-n node_name... Specify the node(s) to be scanned. If this option is not specified and there is a cluster configured, all the
nodes in the cluster will be scanned. If this option is not specified and there is no cluster configured, only the
local node will be scanned.
-o output_file Write configuration information to a specified output file. If this option is not specified, the information will
be directed to stdout.
-s Display the configuration information to the screen only. This option cannot be used in conjunction with the -o
option.
The output from this command contains the following information:
LAN device configuration (On HP-UX, output from lanscan; On Linux, output from ifconfig)
network status and interfaces (output from netstat)
file systems (output from mount)
LVM configuration (contents of /etc/lvmtab file)
LVM physical vg information (contents of /etc/lvmpvg file)
link-level connectivity (HP-UX only)
(output from linkloop)
IPv4/IPv6 connectivity (results from ping (and ping6 on Linux))
binary configuration file data
(output from cmviewconf)
RETURN VALUE
cmscancl returns the following value:
0 Successful completion.
1 Command failed.
EXAMPLES
To gather the configuration information from node1 and node2 and to save the output in file /tmp/scancl.log:
cmscancl -n node1 -n node2 -o /tmp/myscancl.log
To gather the configuration information from all the nodes in the cluster and save the output to the file: /tmp/scancl.log:
cmscancl -o /tmp/myscancl.log
To gather the configuration information from all the nodes in the cluster and display the output on the screen:
cmscancl -s
To gather the configuration information from all the nodes in the cluster and save the output to the file /tmp/scancl.out:
cmscancl
AUTHOR
cmscancl was developed by HP.
SEE ALSO
Linux:
cmviewcl(1), mount(8), netstat(8), ping(8), ping6(8)
HP-UX:
cmviewcl(1m), lanscan(1m), linkloop(1m), mount(1m), netstat(1), ping(1m)
Requires Optional Serviceguard Software cmscancl(1m)