06-06-2003
printing columns
Here's what I wrote:
#!/bin/sh
d1=`grep Dialtone dialtone | awk '{print $2, $3, $4, $5, $6, $7, $8, $9}'`
d2=`grep pstsys dialtone | awk '{print $12}'`
echo "$d1 $d2"
I expected the result to be this:
Dialtone on host 1 slot 13 port 1, pstsys05
Dialtone on host 1 slot 13 port 1, pstsys05
Dialtone on host 1 slot 13 port 1, pstsys05
Dialtone on host 1 slot 13 port 1, pstsys05
But, to my disappointment, the result was:
Dialtone on host 1 slot 13 port 1,
Dialtone on host 1 slot 13 port 1,
Dialtone on host 1 slot 13 port 1,
Dialtone on host 1 slot 13 port 1,
pstsys05
pstsys05
pstsys05
pstsys05
How can I get my "d1's" to show up right next to me "d2's"???
Thx
Chris D.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
ok. this is a bit of a difficult question but i've been trying to figure this out for quite some time but couldn't.
how do I print columns on the screen?
like take for instant. using the ls and the file command, how do i print it so i can have the filenames on the left hand side and the... (3 Replies)
Discussion started by: Terrible
3 Replies
2. UNIX for Dummies Questions & Answers
I am piping an "ls -l" to awk so that all it returns is the file size, date, and file name. The problem is that some files may have spaces in the name so awk is only printing the first word in the file name. I won't know how many space-delimited words are in the filename, so what I want to do is... (2 Replies)
Discussion started by: cassj
2 Replies
3. UNIX for Dummies Questions & Answers
How can I use Perl to a take a string of 10 characters and print the last five characters of the string in columns 1-5 and the first five in columns 6-10?
Result:
0123456789
5 0
6 1
7 2
8 3
9 4 (5 Replies)
Discussion started by: doubleminus
5 Replies
4. Shell Programming and Scripting
Im using awk to print columns. Basically I have a file with like 500 columns and I want to print the 200th-300th column and ignore the rest... how would I do it without putting $200, $201 .... $300
thanks (6 Replies)
Discussion started by: kylle345
6 Replies
5. Shell Programming and Scripting
Gurus,
I have one file which is having multiple columns and also this file is not always contain the exact columns; sometimes it contains 5 columns or 12 columns. Now, I need to find the difference from that particular file. Here is the sample file:
param1 | 10 | 20 | 30 |
param2 | 10 |... (6 Replies)
Discussion started by: buzzusa
6 Replies
6. Shell Programming and Scripting
Hi everyone,
I have been working on a pretty laborious shellscript (with bash) the last couple weeks that parses my firewall policies (from a Juniper) for me and creates a nifty little columned output. It does so using awk on a line by line basis to pull out the appropriate pieces of each... (4 Replies)
Discussion started by: cixelsyd
4 Replies
7. UNIX for Dummies Questions & Answers
Hi Gurus,
I want to extract certain columns from file 2 and combine with file 1.
I am using the following script to extract the columns.
$ awk 'FNR>1{print $2, $9, FILENAME}' *.lim > out1
However, this script does not print the titles of the columns 2 and 9.
Can somebody help me in... (1 Reply)
Discussion started by: Unilearn
1 Replies
8. Shell Programming and Scripting
is there a short one-liner that can print out in columns instead of a long list?
as in, instead of:
apples
oranges
cats
dogs
sky
monkey
giraffe
cups
spoons
tv
cable
it'll print something like this (properly indented of course :) ): (9 Replies)
Discussion started by: SkySmart
9 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have a tab delimited text file with three columns:
Input:
1 25734 25737
1 32719 32724
1 59339 59342
1 59512 59513
1 621740 621745
For each row of the text file I want to print out all the values between the second and third columns, including them. The... (3 Replies)
Discussion started by: evelibertine
3 Replies
10. Shell Programming and Scripting
Hi,
I need just to print the values of second and fourth column from a file
# cat dispaly
id Name Std Specialist
1 sss X mathematics
2 uyt IX geography
3 vcd X English
i tried with some NF command.. I think am wrong.. Is there anyother way to print my requirement (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
LEARN ABOUT OSX
fibreconfig
fibreconfig(8) BSD System Manager's Manual fibreconfig(8)
NAME
fibreconfig -- Tool for configuring settings for Fibre Channel controllers and targets.
SYNOPSIS
fibreconfig [-r] [-c xx:xx:xx:xx:xx:xx:xx:xx] [-a AL_PA] [-s port_speed] [-t topology_type] [-l] [-v]
OPTIONS
The available options are as follows:
-r Dynamically updates system settings. Note: Cannot be used in conjunction with -c option.
-c Defines the host port used for an operation. By default, if no other options are specified, fibreconfig will display information
about the specified host port.
-a Sets the AL_PA for specified host port. The AL_PA must be one of the values defined in Table 1.1 located in the examples section.
-s Sets speed to [ 1gigabit, 2gigabit, 4gigabit, auto ] for specified host port.
-t Sets topology to [ nport, nlport, auto ] for specified host port.
-l Lists all known information about all nodes ( controllers, targets, and their LUNs ).
-v Display version number.
RETURN VALUES
Returned Error Code
0 No error.
-50 Error in user parameter list.
FILES
/sbin/fibreconfig
Executable for version 2.0 and later.
EXAMPLES
1. Set the AL_PA to 1E for a given host port.
fibreconfig -c 00:11:22:33:44:55:66:77 -a 1E
2. Disable the AL_PA for a given host port.
fibreconfig -c 00:11:22:33:44:55:66:77 -a FF
3. Set the speed to auto for a given host port.
fibreconfig -c 00:11:22:33:44:55:66:77 -s auto
4. Set the topology to nlport for a given host port.
fibreconfig -c 00:11:22:33:44:55:66:77 -t nlport
5. Table 1.1 List of valid AL_PA settings:
=======================================
01 02 04 08 0F 10 17 18 1B 1D 1E 1F 23 25 26 27 29 2A 2B 2C 2D 2E 31 32 33 34 35 36 39 3A 3C 43 45 46 47 49 4A 4B 4C 4D 4E 51 52 53 54
55 56 59 5A 5C 63 65 66 67 69 6A 6B 6C 6D 6E 71 72 73 74 75 76 79 7A 7C 80 81 82 84 88 8F 90 97 98 9B 9D 9E 9F A3 A5 A6 A7 A9 AA AB AC
AD AE B1 B2 B3 B4 B5 B6 B9 BA BC C3 C5 C6 C7 C9 CA CB CC CD CE D1 D2 D3 D4 D5 D6 D9 DA DC E0 E1 E2 E4 E8 EF
DIAGNOSTICS
Return value on exit provides information about the success or failure of the utility.
ERRORS
See return values.
HISTORY
Last updated February 1, 2005.
BUGS
Known issues:
1. Currently only displays information for Apple shipped Fibre Channel cards.
Mac OS X October 27, 2004 Mac OS X