Sponsored Content
Top Forums Shell Programming and Scripting Read any lines of text from file Post 302363205 by versace on Monday 19th of October 2009 05:20:11 PM
Old 10-19-2009
not the case, has further explained:

I am doing a script that queries the ports of my server and saves results to a file in the form:

=== file wyn1.log ===
open
closed
closed
open
open
================

the first line is the first port of argument given in the script for the second line is the second port of script given as an argument ........

I need to read any line.

Code:
nmap -n -r -p$port $domena | awk 'BEGIN {RS=" "} /closed/ || /open/ ' >>  wyn1.log

So far, I checked the port so only one option
Code:
echo-e "Port $port is:` head wyn1.log `" >> end.log

but I want to query enough clicks away at the same time my question.


Know, words will be repeated in a different order, and will focus on different ports.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to read lines in a text file and filter user data

hi all, I have this file with some user data. example: $cat myfile.txt FName|LName|Gender|Company|Branch|Bday|Salary|Age aaaa|bbbb|male|cccc|dddd|19900814|15000|20| eeee|asdg|male|gggg|ksgu|19911216||| aara|bdbm|male|kkkk|acke|19931018||23| asad|kfjg|male|kkkc|gkgg|19921213|14000|24|... (4 Replies)
Discussion started by: srimal
4 Replies

2. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

3. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

4. UNIX for Dummies Questions & Answers

Extracting lines from a text file based on another text file with line numbers

Hi, I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

5. Shell Programming and Scripting

Read text between two lines containing a string

Hi, I have text file like the following: Start a b 121 c d End Start a 31 e f End Start p o i k (5 Replies)
Discussion started by: ysrini
5 Replies

6. Shell Programming and Scripting

How to delete lines of a text file based on another text file?

I have 2 TXT files with with 8 columns in them(tab separated). First file has 2000 entries whereas 2nd file has 300 entries. The first file has ALL the lines of second file. Now I need to remove those 300 lines (which are in both files) from first file so that first file's line count become... (2 Replies)
Discussion started by: prvnrk
2 Replies

7. Shell Programming and Scripting

Read n lines from a text files getting n from within the text file

I dont even have a sample script cause I dont know where to start from. My data lookes like this > sat#16 #data: 15 site:UNZA baseline: 205.9151 0.008 -165.2465 35.8109 40.6685 21.9148 121.1446 26.4629 -18.4976 33.8722 0.017 -165.2243 48.2201 40.6908 ... (8 Replies)
Discussion started by: malandisa
8 Replies

8. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

9. Shell Programming and Scripting

Read in search strings from text file, search for string in second text file and output to CSV

Hi guys, I have a text file named file1.txt that is formatted like this: 001 , ID , 20000 002 , Name , Brandon 003 , Phone_Number , 616-234-1999 004 , SSNumber , 234-23-234 005 , Model , Toyota 007 , Engine ,V8 008 , GPS , OFF and I have file2.txt formatted like this: ... (2 Replies)
Discussion started by: An0mander
2 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
APLAYMIDI(1)						      General Commands Manual						      APLAYMIDI(1)

NAME
aplaymidi - play Standard MIDI Files SYNOPSIS
aplaymidi -p client:port[,...] [-d delay] midifile ... DESCRIPTION
aplaymidi is a command-line utility that plays the specified MIDI file(s) to one or more ALSA sequencer ports. OPTIONS
-h, --help Prints a list of options. -V, --version Prints the current version. -l, --list Prints a list of possible output ports. -p, --port=client:port,... Sets the sequencer port(s) to which the events in the MIDI file(s) are sent. A client can be specified by its number, its name, or a prefix of its name. A port is specified by its number; for port 0 of a client, the ":0" part of the port specification can be omitted. Multiple ports can be specified to allow playback of MIDI file(s) that contain events for multiple devices (ports), as specified by "Port Number" meta events. For compatibility with pmidi(1), the port specification is taken from the ALSA_OUTPUT_PORTS environment variable if none is given on the command line. -d, --delay=seconds Specifies how long to wait after the end of each MIDI file, to allow the last notes to die away. BUGS
aplaymidi handles "Port Number" meta events, but not "Port Name" meta events. SEE ALSO
pmidi(1) playmidi(1) AUTHOR
Clemens Ladisch <clemens@ladisch.de> 2 Nov 2011 APLAYMIDI(1)
All times are GMT -4. The time now is 10:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy