Sponsored Content
Top Forums Shell Programming and Scripting Can't Output Piped Perl In-line command to a File Post 302770230 by ConcealedKnight on Thursday 14th of February 2013 11:29:57 PM
Old 02-15-2013
I just figured out which command's the culprit. It seemed that the tcpdump doesn't play nicely with the stdout when combined with a pipe. Although I still don't know why yet as I am currently not in the mood to read the info and man pages this late.

I had to run three command executions to get the result I wanted. Here's the code in case you're wondering:
Quote:
(tcpdump -l -n -t "tcp[13] == 18" > /tmp/removeme) && cat /tmp/removeme | perl -ane '($s,$j)=split(/,/,$F[7],2); print "$s\n";' > ./graphme && rm /tmp/removeme
Thanks though.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl... how to tell if a piped command is still running?

I'm using the fabulous perl. I need a way to tell when a piped call to "open" has completed. Can I do this with a command like <ShellPipe> ?? Reason behind this: I'm trying to write a backup script in perl! This script will download a certain file from my web server, to my computer. Now,... (0 Replies)
Discussion started by: boytheo
0 Replies

2. Shell Programming and Scripting

Identify matching data in a file and output to original line, in perl

Hi, I haven't done this for awhile, and further, I've never done it in perl so I appreciate any help you can give me. I have a file of lines, each with 5 data points that look like this: AB,N,ALLIANCEBERNSTEIN HLDNG L.P,AB,N ALD,N,ALLIED CAPITAL CORPORATION,ALD,N AFC,N,ALLIED CAPITAL... (4 Replies)
Discussion started by: Pcushing
4 Replies

3. Shell Programming and Scripting

script output should be piped to a file

hi i have a script named mount.sh under the location /data/scripts/ in my aix box i want this script this to be run everyday morning at 04:45 AM and the output of the script should be piped to a file how to do this ? (3 Replies)
Discussion started by: samsungsamsung
3 Replies

4. Shell Programming and Scripting

Insert shell command into first line of output file

How can I insert the command executed on the shell into the first line of my output file? For example if I execute; zcat *.gz |grep “User5501” > users.out How can I make my users.out look like; zcat *.gz |grep “User5501” > users.out User5501 PA User5501 UA User5501 ZA... (3 Replies)
Discussion started by: lewk
3 Replies

5. UNIX for Dummies Questions & Answers

Finding the modified timestamp of files from the piped output of du command

Version Info +++++++++++++++ RHEL 5.4 Since ls command lists file sizes in Bytes which can be long I use du command like below. I have run the du command for the below files as shown below. But I want pipe this output to ls command just to see the modified timestamp for these files. ... (7 Replies)
Discussion started by: kraljic
7 Replies

6. Shell Programming and Scripting

sed command to replace a line in a file using line number from the output of a pipe.

Sed command to replace a line in a file using line number from the output of a pipe. Is it possible to replace a whole line piped from someother command into a file at paritcular line... here is some basic execution flow.. the line number is 412 lineNo=412 Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies

7. Shell Programming and Scripting

Modifying file from command line using Perl

Hi all, I am having a slight issue updating a file using perl from the command line I need some help with. The item is: DATA_FILE_TYPE=FULL When I run the below command /usr/bin/perl -p -i -e "s/DATA_FILE_TYPE=/DATA_FILE_TYPE=APPEND/g" processfile.cfg It looks to be... (2 Replies)
Discussion started by: kstevens67
2 Replies

8. Shell Programming and Scripting

Print line number from piped output

i need to do something like this: script.sh #!/bin/sh echo "hello" echo "My First name is John" echo "My Last name is Smith" echo "I am here to save you a lot of work" sed -n 4,5p $0 i dont want to run the script. i just want to pull out specific line from it. so the logic here... (5 Replies)
Discussion started by: SkySmart
5 Replies

9. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

I am looking for help in processing of those options: '-n' or '-p' I understand what they do and how to use them. But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.) I did try it and -n works on 2 files. Question is: - is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies

10. Shell Programming and Scripting

Use cut output as variable piped awk command

Hi, I would like use the output of my cut command as a variable in my following awk command. Here's what I've written. cut -f1 info.txt | awk -v i=xargs -F'' '{if($6 == $i) print $20}' summary.txt Where obviously the 'xargs' doesn't do what I want. How can I pass my cut result to my awk... (3 Replies)
Discussion started by: heyooo
3 Replies
IWGETID(8)						     Linux Programmer's Manual							IWGETID(8)

NAME
iwgetid - Report ESSID, NWID or AP/Cell Address of wireless network SYNOPSIS
iwgetid [interface] [--raw] [--scheme] [--ap] [--freq] [--mode] [--protocol] [--channel] DESCRIPTION
iwgetid is used to find out the NWID, ESSID or AP/Cell Address of the wireless network that is currently used. The information reported is the same as the one shown by iwconfig, but iwgetid is easier to integrate in various scripts. By default, iwgetid will print the ESSID of the device, and if the device doesn't have any ESSID it will print its NWID. The default formatting output is pretty-print. OPTIONS
--raw This option disables pretty-printing of the information. This option is orthogonal to the other options (except --scheme), so with the appropriate combination of options you can print the raw ESSID, AP Address or Mode. This format is ideal when storing the result of iwgetid as a variable in Shell or Perl scripts or to pass the result as an argument on the command line of iwconfig. --scheme This option is similar to the previous one, it disables pretty-printing of the information and removes all characters that are not alphanumerics (like space, punctuation and control characters). The resulting output is a valid Pcmcia scheme identifier (that may be used as an argument of the command cardctl scheme). This for- mat is also ideal when using the result of iwgetid as a selector in Shell or Perl scripts, or as a file name. --ap Display the MAC address of the Wireless Access Point or the Cell. --freq Display the current frequency or channel used by the interface. --channel Display the current channel used by the interface. The channel is determined using the current frequency and the frequency list pro- vided by the interface. --mode Display the current mode of the interface. --protocol Display the protocol name of the interface. This allows to identify all the cards that are compatible with each other and accept the same type of configuration. This can also be used to check Wireless Extension support on the interface, as this is the only attribute that all drivers support- ing Wireless Extension are mandated to support. SEE ALSO
iwconfig(8), ifconfig(8), iwspy(8), iwpriv(8). wireless-tools 02 December 2003 IWGETID(8)
All times are GMT -4. The time now is 09:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy