General :: Nawk - Input From A Pipe And A File At The Same Time

Sep 16, 2010

I am tying to read a file in with nawk whilst trying to take input from a pipe. I've come across the getline option and no matter how hard I try, I can't figure out the correct syntax. What I want to do is to take some input from the pipe and make a comparison with all of the values in a file and print a match.

Code:

View 2 Replies


ADVERTISEMENT

Programming :: Multiple Input Into Seq Command From Pipe - Single Column Unique Numbers

May 13, 2011

Have this script which is reading in a series of files, one at a time with while-do-done loop, each file goes through various greps/awk's where this info is then saved to various files for later use. i.e....

Script is being run on Linux Red Hat,

In one of the grep/awk's the output (currently) are 2 columns (min max), i.e....| awk '{print $1, $2}' | sort -u which outputs (e.g.)

The number of "min max" pairs varies from file to file. Want to output a single column of unique numbers from the min max pairs & get the number of them for input to a file...i.e...

Where <PROCESS> is some process/technique that will generate a single column of integers (increment of 1) to pipe into the next one (sort -u)

i.e. (example from above)

Have tried command seq - only works for single pair input i.e.

Is there any command like seq etc which will output a single column based on a input of min max numbers (increment 1) to pipe onwards to next command?

View 4 Replies View Related

General :: Read File And Pipe To Grep

May 26, 2011

I'm storing a list of strings in a file and would like to read the file and pipe each line returned to grep which in turn searches a directory for files containing the string.However this is not returning any output.

View 2 Replies View Related

General :: What Is Meaning That File Is Named Pipe (FIFO)?

Jul 12, 2011

What is a pipe? and why a file is a named pipe? I am just learning linux.

View 2 Replies View Related

General :: Feed Text To File Editor From Named Pipe

Apr 24, 2011

Does any one know how can i input text by reading from a named pipe to any popular GUI based text editor?

View 5 Replies View Related

General :: Keyboard Input Time Is More For Typing Commands?

Aug 15, 2010

While typing commands it takes more time to type.let me know on how to correct this

View 3 Replies View Related

Programming :: Handle A Broken Pipe Exception (SIGPIPE) In FIFO Pipe?

Mar 2, 2011

I've written a simple server in linux used fork to create a FIFO pipe.The server create two FIFO pipe.One for server read data from client and write data to client.Then another pipe for client read data from server and write data to server.When the server read data from a client used server-pipe and then write data to client.But ,if the client no read open the pipe,the server side write will be crashed because of a broken-pipe SIGPIPE. How to check whether the read side is opened?Or,how to catch the SIGPIPE,and then my server will still execute on,not crashed!!

View 5 Replies View Related

General :: Data From Input File To Be Taken And Send To Output File?

Jul 24, 2010

I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:

3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---

[code]...

View 14 Replies View Related

Networking :: PING - Pipe 2 Versus Pipe 3

Apr 10, 2009

I'm doing ping between 2 RH servers through a VPN site2site tunnel and in some times I got in the result pipe 2 and another pipe 3 as I mark it in blue color below.

e.g.

64 bytes from 192.168.1.10: icmp_seq=0 ttl=128 time=0.229 ms
64 bytes from 192.168.1.10: icmp_seq=1 ttl=128 time=0.287 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=128 time=0.278 ms

[code]....

What's the difference between pipe 2 and pipe 3 and what's the meaning of it?

View 1 Replies View Related

General :: Getting Input From A File?

Dec 2, 2010

I am trying to input from a file. The file's layout has three columns; a department number, a first name and a last name, each separated by a space, for example:

Code:

781-89-4271 Amy Balduff
839-98-4072 Brian Becker
846-43-4284 Christina Brendon

[code]....

I need to input the words through separate variables because I will be passing them to other programs as soon as I can figure this out.

View 9 Replies View Related

Ubuntu :: Can't I Pipe Into The 'file' Command?

May 9, 2010

I'm looking for an mp3 file in the firefox cache folder.I was thinking I could run the command 'find -size +2M' and pipe that output into the 'file' command to tell me which is an mp3, something like thisfind -size +2M | fileBut this doesn't work, what am I doing wrong?This is output Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...file -C -m magicfilesTry `file --help' for more information.

View 4 Replies View Related

Programming :: Pipe Output Of Ls To File?

May 3, 2011

I want to pipe the output of ls in a folder to a file (lets call it test.txt) but when i do so, but when i do ls > test.txt in test.txt there is also test.txt (logical

View 4 Replies View Related

Programming :: Matching Numbers With Nawk

May 11, 2011

I am struggling to understand why nawk matches values that are either 1 or 2 digits in length, but not 100 (3 digits).

Am I missing something obvious ? Should I use substr to remove the % ?

I am sure it's something to do with character and string matching behaviour with nawk.

Code:

View 9 Replies View Related

Programming :: Install Nawk Command ?

Feb 10, 2010

How to install nawk command in linux

View 3 Replies View Related

Red Hat :: Nawk On CentOS 5.6 - Can't Find The Rpm Or Tarball

May 15, 2011

I am looking for nawk on CentOS 5.6 but so far can't find the rpm or tarball. Any input in locating a working copy.

View 4 Replies View Related

General :: Input To Sudo - What Is Its File Descriptor

Aug 5, 2011

Where does input to sudo go? I mean when we give password to sudo prompt where it actually goes? If it goes to a file what is its name or what is its file descriptor?

View 1 Replies View Related

General :: Xkbprint Error: No Input File Specified

Mar 18, 2011

when I try to print the current keyboard layout with "xkbprint -o layout.ps" it gives me the error mentioned in the subject. I also remember printing it a couple of weeks ago (and I'm sure I didn't specify any additional options), but now it just doesn't work. Everything I read on the Net assume this command prints the current layout, and so far I haven't discovered even the slightest mention of this error. It's a trifle, but it drives me mad. What could I be doing wrong?

View 1 Replies View Related

Fedora :: How To Pipe Output Of Wine Into File

Aug 19, 2009

I have a bug where WoW under wine is crashing my computer, and I want to get the data from the console, so I want to put it in a file, but I don't know how! None of the piping tutorials online helped at all.

View 2 Replies View Related

Software :: Pipe Email Using Aliases File Or Script?

Jul 26, 2010

have some problems in doing my project, my project title is ' in investigate into implementation of certification authority with small network ' ( with using Postfix, openSSL ) and i have builded up two different networks using debian and after that i need to make a mail server, so i configured Postfix and made a mail server, i can send and receive emails on both networks. now i need a shell script on received emails using Postfix, like mail is coming from outside then will go to pipe and there should a script in bash, that will run and check the email and deliver to others, or throw it away some thing like that... here are some links where i was looking

[URL]

View 1 Replies View Related

General :: Permission Denied When Creating File (Input Document)

Jul 11, 2011

I am trying to create:

/etc/X11/Xsession.d/95xinput document
where
/etc/X11/Xsession.d is a folder.

So I enter the above commands:
cd /etc/X11/Xsession.d
nano 95xinput

I type my text and when I try to save it it says that permission is denied.

View 7 Replies View Related

General :: Read From Input File And Append To Multiple Files?

Nov 22, 2010

I wanted to be as clear as possible. I have to add hundreds of new servers to hundreds of configuration files in Nagios. Here is a sample structure:

servers.txt has:
SERVER3
SERVER4

[code]....

View 10 Replies View Related

General :: Parsing File Dates - Get The Date Of The Last Time A File Was Modified ?

Jan 11, 2010

I need to get the modified date on a file in linux to use in a script.I tried using 'ls -l' on the file, but this caused problems when the date turned from a single digit into a double. The reason for the problem was because I was parsing the result string on spaces.How can I get the date of the last time a file was modified so I can use it in a script? For example, if a file was modified on 1/11/2010, I need the 11.

View 2 Replies View Related

Ubuntu :: Get Postfix To Receive Mail From One Address And Pipe It To A PHP File?

Oct 7, 2010

Im running Ubuntu server 10.04 lts

Im trying to get postfix to receive mail from one address and pipe it to a PHP file for a help desk software called Trellis Desk.

They recommended that I use Cpanel but its not free and my boss is not willing to pay for it. I need a free solution.

I know my way around Linux but Im no professional

View 1 Replies View Related

Programming :: Orrect Command To Create A Named Pipe File?

Apr 22, 2010

My question deals with me creating a name pipe (file) in the my /group directory called chat.I then have to write a script to read from the named pipe and save data into a file called chat.log until the words End of File are passed to the program.

-When I created the named pipe file (chat) I used the mknod chat p command..Is this the correct command to create a named pipe file? -Then I'm having trouble with my script and how to make it run until the words End of File are entered in. This is what I have so far.

View 6 Replies View Related

General :: Store User Input In A Config File GUI For A BASH Script?

Dec 4, 2010

I'm trying to create a backup script. For my second version, I want to make a GUI that will ask the user three things:

1. which folders should be excluded
2. where to store the backup
3. the user's email

I need to store this input, and later input the values into variables in my script. How do I go about doings this?

View 1 Replies View Related

General :: Bourne Shell Input From File Using - Then Return Control To User?

May 5, 2011

I have a program that I run from the terminal that requires manual input (it's matlab in mex debugging mode, matlab -Dgdb, which starts the GNU C debugger with its own custom settings).

Every time I run this program I always type in the same few commands in the program's interactive shell before I actually start working (for example: run -nojvm; stop at mexFunction; continue). I want to avoid typing these commands and I thought I could do this with shell scripting, saving the commands in the mycommands file, then running: myprogram < mycommands

The problem is that this runs all the commands and then exits the program. I want it to run the commands and return control to me so I can run my commands. Is there a way to tell the shell to use a file or a string as the input to a program then immediately return control to the user without the exiting the program?

View 3 Replies View Related

Ubuntu Multimedia :: Pipe A Video Feed From Virtual Box To Vlc And Save It As A File?

Aug 9, 2011

is there a way to pipe a video feed from virtual box to vlc and save it as a file? cause if i could then i could save streaming videos from places like hulu and netflix or save bluray movies to a avi file for latter use.

View 6 Replies View Related

General :: Open A Script File (same File Every Time)?

Aug 12, 2010

I need to goto a folder, open a script file (same file every time). The file has different function calls, I need to comment all other function calls and just un-comment the one I want to use.

#call_1
call_2
#call_3

[code]....

View 14 Replies View Related

General :: Create A Multiple Files By Reading A Input File And Changing The Contents?

Sep 16, 2009

Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .

I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.

I want to create a mutiple output files with each file having a seperate code which is stored in text file and create XYZ_222_999_YYYYMMDD_1.TXT . and add date in the contents next to series of numbers .Like this

Before change the file looks like this

file name XYZ_111_999_YYYYMMDD_1.TXT

001,19SEP2009-14:05:05,000000003
1234
4567
6785
END_OF_DATA

[Code]....

View 4 Replies View Related

Programming :: Move Line Of Pipe Delimited Flat File If Field 27 = Sold?

Sep 26, 2010

I have a pipe delimited flat file, field 27 is price. I would like to move items marked sold to a new file every couple months.

awk -F"|" '$27 == "SOLD" {print $0}' awktest2.data >> awkout2.data

Allows me to write line to new file but I need to delete the original line, I also want to make sold case insensitive tried [Ss][Oo] with no luck

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved