02-07-2007
traversing line by line in a file
we need to capture a record from a file in to a variable and do modifications to it .. so capturing line by line in a file in to some variable
Last edited by lmadhuri; 02-07-2007 at 08:15 AM..
Reason: enhancement in requirement
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a file that has several values seperated by ":"
2006:John:Student:Football:Portugal:Cinema
2006:James:Engineer:Basket:Poland:Theatre
2007:Lucy:Diver:Gymnastic:England:Music
2007:Smith:Plumber:Basket:Spain:Poker
I need make a filter based on the 5th field to find countries that... (1 Reply)
Discussion started by: efernandes
1 Replies
2. UNIX for Dummies Questions & Answers
HI,
Your help was great: awk -F":" '$5 ~ /^P/{print }' file
I would like to know what changes need to be done to this line code, so that I can put it in a shell script and call it as the example below.
example: countries that start with chacater 'P'
> country P
Result:
... (0 Replies)
Discussion started by: efernandes
0 Replies
3. Shell Programming and Scripting
I've got a file with the following layout:
#STMP FSgroup
filename /filesysname1
filestatus 2
#STMP FSstatus
filename /filesysname1
ratio 30
#STMP FSgroup
filename ... (2 Replies)
Discussion started by: paulsew
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I want to retrieve a particular line from a file and print its content to a file. Can you suggest how to do it in UNIX ?.
Rgds
vinayap (2 Replies)
Discussion started by: vinayap
2 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I want to retrieve 2, 6, 10, 14...... (each 4 lines apart) from a file that looks like the sample below. In other words, I want only lines corresponding to the Xs.
Header1_a
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Header1_b
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Header2_a... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
6. Shell Programming and Scripting
I have a file which contains several lines. Sample content of the file is as below.
OK testmessage email<test@123>
NOK receivemessage email<123@test>
NOK receivemessage email(123@test123)
NOK receivemessage email<abc@test>
i would like to know by scripting will... (10 Replies)
Discussion started by: ramasar
10 Replies
7. Shell Programming and Scripting
Hi i'm new to shell script,
i want to get the filename from specific location which i mentioned in my script.
The scirpt should read the filename exactly using the following command "ls -ltr | tail -1".
Could someone show me on this. Below is my script
#!/bin/ksh
PATH= /usr/
if
then
... (4 Replies)
Discussion started by: fresher
4 Replies
8. UNIX for Beginners Questions & Answers
Hi Everyone,
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file? Please let me know what is the awk command for this?
Regards
Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file?... (6 Replies)
Discussion started by: rakeshp
6 Replies
10. UNIX for Beginners Questions & Answers
I am having trouble matching *two* strings from one file anywhere in a line of a second file, and could use some help getting this figured out. My preference would be to use grep for this because I would like to take advantage of its -A option. The latter is due to the fact that I would like both... (2 Replies)
Discussion started by: jvoot
2 Replies
LEARN ABOUT DEBIAN
pcapdump
pcapdump(1) pcapdump(1)
NAME
pcapdump - dedicated packet capture utility
SYNOPSIS
pcapdump [OPTIONS]...
DESCRIPTION
pcapdump captures packets from a network interface and writes them to a dumpfile. The filename argument given to -w will be formated by
strftime(3).
PCAPNET OPTIONS
-i interface
Input interface to read packets from.
-r pcap file
Dump file to read packets from.
-w pcap file
Dump file to write filtered packets to.
-f expression
BPF expression which selects packets to be filtered.
-s snaplen
Capture snaplen bytes of data from each packet.
-p Disable promiscuous mode sniffing.
PROGRAM OPTIONS
-u owner
Set the output file's owning user to owner.
-g group
Set the output file's owning group to group.
-m mode
Set the output file's mode to mode, specified in octal.
-t secs
Dump file rotation interval in seconds.
-c count
Exit after capturing count packets.
-T secs
Exit after capturing during this amount of seconds.
-H Only capture link, network, and transport headers; do not capture application-layer data.
-S sample value
Sample the packet stream by only dumping 1 in every sample value packets.
-R Together with -S, sample the packets randomly, not systematically.
-P pidfile
Daemonize the process and write its PID to pidfile.
-C config file
File to read configuration variables from. Instead of passing configuration through the command line, a file can be used to specify
values for the bpf, device, filefmt, group, interval, mode, owner, promisc, and snaplen options (not all need to be specified; de-
faults will be used otherwise). See /usr/share/doc/pcaputils/examples/pcapdump/eth0 for an example.
9 May 2009 pcapdump(1)