how to create output like this


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to create output like this
# 1  
Old 03-28-2008
how to create output like this

currently i have two clients connecting to my wifi router
in telnet router, i typed the command :

~# dumpleases

then it showed as following:

Hostname Mac Address IP-Address
billfan 00:15:00:15:c1:7e 192.168.11.100
00:16:cf:47:e7:ab 192.168.11.101

one of the client dont have hostname
if i just need to output mac address and ip-address for each client in a loop, say
dumpleases | awk '/'"$assocLINE"'/ {print $2, $3}'
it will show mac address and ip-address correctly for the first client
but it will start at wrong column for the second client (ip address and nothing else)
how to solve that problem?
# 2  
Old 03-28-2008
# dumpleases | awk '/'"$assocLINE"'/ {print $(NF-1), $NF}'
# 3  
Old 03-28-2008
thanks man!
# 4  
Old 03-28-2008
how to use print in awk without next item moving to new line
# 5  
Old 03-28-2008
printf without a newline would do it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need a script to create specialized output file

I need a script to process the (space-separate) values for each line as seen in the below input file and then output the data into an output file as follows. We have been unable to create this using typical bash scripting and cold not find anything out on the internet similar to what we are trying... (3 Replies)
Discussion started by: ddirc
3 Replies

2. Shell Programming and Scripting

Create specific output

I have a file that looks like the below and only need certain lines, but am not sure how to do that. It is basically everything from the @HD up to the @RG. Thank you :). file.txt - input @HD VN:1.4 GO:none SO:coordinate @SQ SN:chr1 LN:249250621 @SQ SN:chr2 LN:243199373... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Shell Programming and Scripting

Create a two column output in bash

Hi! I m newbie for scripting. My requirement is to create a host file as below from the output of aws api. Hostname PrivateIP abc x.y.x.z cde a.b.c.c and so on. I have the following script, #!/bin/bash export AWS_ACCESS_KEY=abc export... (5 Replies)
Discussion started by: cuteboyucsc
5 Replies

4. Shell Programming and Scripting

Using scripts to create output files

been messing around with linux for a few months...not too good yet. thinking about taking a class or something, this #### is hard.......anyway, im trying to make an output file using the input from a prompt. heres basically what i have now (random example) echo -n "Please enter your name: " read... (7 Replies)
Discussion started by: rickbobb4444
7 Replies

5. Shell Programming and Scripting

Bash: create a report with grep output?

Greetings. I need to generate a simple report via Bash (Korn?) with this raw data Test_Version=V2.5.2 Test_Version=V2.6.3 Test_Version=V2.4.7 Test_Version=V2.5.2 Test_Version=V2.5.2 Test_Version=V2.5.1 Test_Version=V2.5.0 Test_Version=V2.3.9 ... (3 Replies)
Discussion started by: alan
3 Replies

6. AIX

create file and name it with same output name !

Guy's I have this command echo $? when I type it in AIX it will showme 0 I want when I type that command to create file in the same location with the same output of echo $? For exampl : I will execute the command now .... P_server/root/echo $? 0 the output is 0 so I want... (2 Replies)
Discussion started by: Mr.AIX
2 Replies

7. Shell Programming and Scripting

to create an output file as a table

Hi, I have four input files and would like to create an output file as a table. Please check the example below. File 1. 111111 222222 333333 444444 File 2. 555555 666666 777777 888888 File 3. aaaaa bbbbb ccccc ddddd (2 Replies)
Discussion started by: marcelus
2 Replies

8. Shell Programming and Scripting

how to create a logfile to track the below script output

Hi Dudes, Can you please suggest me how to create a logfile to track the below script output ? Thanks #!/bin/ksh # backup the "std" I/P file descriptor exec 5<&0 #echo "Proceed ?" while read config_line; do # backup the I/P file descriptor of "while" block exec 6<&0 # restore the... (2 Replies)
Discussion started by: shirdi
2 Replies

9. UNIX for Dummies Questions & Answers

create PATH from find command output

I'm trying to autogenerate a PATH variable from the output of a find command as follows: PATH=`find $dir -name "*.jar" | sed 's/$/:/'` The output looks similar like this if I echo it: PATH=/path/to/1.jar: /path/to/2.jar: /path/to/3.jar: I want the path to be on one line. I'm on... (3 Replies)
Discussion started by: rein
3 Replies

10. Shell Programming and Scripting

Applying diff output to create new script

I believe I read somewhere that you can do a diff of two ksh scripts and use the output to create a new script with the differences. :p Could someone please show me the command(s) I'd need to use to get this accomplished? Or perhaps point me to a thread that explains this in detail. Thanks... (1 Reply)
Discussion started by: BCarlson
1 Replies
Login or Register to Ask a Question