Programming :: Awk: Print Out A Message To The Screen When Redirecting The Output To File?

Mar 15, 2010

I have a problem when using awk:

e.g: awk '{processing text}' File1 > File2

But when I'm processing the File1, I want to print out some messages to the screen (not the File2). How can I do that?

View 5 Replies


ADVERTISEMENT

Programming :: Use Regex In Perl Script To Detect Allowed Words From The File And Then Print Output To The Screen?

Oct 4, 2010

Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.

As an example : I have text file with orders and returns :

Item2-SKU-2-11.08.2010-online
Item3-SKU-3-11.09.2010-return
Item4-SKU-4-11.09.2010-store

My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)

View 1 Replies View Related

General :: Redirecting Output Message While Inserting A New Device?

Dec 28, 2010

When inserting/removing a usb device to a board based on linux system, an output is given:

Code:
# mmc1: card 0001 removed
mmc1: new SD card at address 0001

[code]...

View 6 Replies View Related

General :: Message In Terminal After Redirecting Output And Build Completes?

Oct 9, 2010

I'm not sure about the following behavior so thought I would put it out to see if there is an error I need to resolve, or simply a process that I need explained.I'm also not sure if this is an Ubuntu issue, a Linux issue, or other... but here goes.I ran my "make build" in two different ways; one with just "make build" and one with "make build > output" (so I could review the full script).With just "make build" the process finished and returned to the command prompt.

With "make build > output", after the process had finished (script in output document identical to what was in the terminal with "make build") a new set of data was displayed in the terminal (see below).With the other examples of using "make build > output" the times it would parse something back to the terminal window was when there was an error. As I fixed the errors these breaks back to the terminal window would stop. So I'm wondering if this indicates a new error, but because the "make build" now completes successfully (at least it appears to), I'm wondering if this data in the terminal window is just a behavior related to redirecting the output script using the ">" process and something to do with returning to the terminal once a process completes

View 4 Replies View Related

Programming :: Write A Driver In C So That When Released The Key Some Message Will Printed In Output Screen?

Nov 22, 2010

I want to write a driver in c so that when i released the key some message will printed in output screen. The driver should be for arm.I have a driver which read the key when it is pressed.But i want the both (means key press and release).

View 3 Replies View Related

Programming :: Redirecting The Output Of Child Process To New Xterm?

Aug 2, 2010

I am developing a application. In this I fork() 3 childs(lets say child1 , child2, child3) . The parent is now waiting for some input from keyboard.Child3 is continously getting data from child1 and child2 using pipe which it then will print using printf.Now as the parent is waiting for input from user through keyboard while child3 is continously printing the data. I want to do it in different terminals.Can you please guide me how to proceed ahead so that on one terminal , the parent waits for input fromser while on other terminal child3 prints data.

View 1 Replies View Related

General :: Redirecting Command Output To File?

Sep 19, 2011

This seems so simple when doing it from command line but I'm not able to accomplish it inside a script. I am trying to put output of following command into a text file:

CMD= mysql -uroot -psecret -e 'SHOW SLAVE STATUS G;'
FIL=~/replication-`date +%F`.txt
MAILTEXT=~/mailtext.txt
touch $FIL
$CMD > $FIL

Where FIL is a variable that contains path of the file to which to output command. I am running this command in a shell script from where I want to email contents of $FIL as attachment using mutt. But I am always getting 0 byte file. Also if I examine in directory the file is of 0 byte length.

View 3 Replies View Related

Programming :: C - Can't Print In Screen The Content Of File

Mar 20, 2010

why this code can't print in the while loop the content of the file ?

Code:

#include <stdio.h>
int main()
{
FILE *fp;

[code]...

View 7 Replies View Related

Programming :: Redirecting Stdout To File And Terminal And Stderr To File?

Apr 20, 2010

I have a script where I want to redirect stdout to the terminal and also to a log file aswell as redirecting stderr to the same log file but not the terminal.I have the following code which I found on the net which redirects both stderr and stdout to a file and the logfile,

Code: if [ -p $PIPE1 ]
then
rm $PIPE1

[code]...

View 3 Replies View Related

Programming :: Print Message When Changing Directories

Jul 21, 2010

I need some direction on a small scripting question. I've been doing some development and storing the code on a network drive with multiple user access. My development is getting complex enough that it is time to set up a svn repo for it. I would like to set up a little script (if possible) that prints a message/reminder to whomever is accessing the code directory stating that the code is ultimately stored in svn and any changes need to be checked in, etc. Is there a way to have linux print a message to the screen based on a 'cd /specific_dir/' command? So far google is mum on the topic. Using Debian and bash shell.

View 5 Replies View Related

Programming :: Why Doesn't The Javax Swing Message Print

Mar 18, 2010

why the message string isn�t output to the Applet window in the code below?

Code:
import javax.swing.*;
class printit extends JApplet {

[code].....

View 4 Replies View Related

Programming :: Print A Message When A Diff Shows Files Match?

Jul 16, 2009

I'm writing a script using ksh that diffs two dirs that contain about 30 files, and writing the results on a logfile. When files differ, it writes the difference with no problem, but I also need the script to write a message if no differences are found.

View 3 Replies View Related

General :: How To Print Command Output To A File

Apr 29, 2010

I am creating a script to sync my important documents between two system. I want my script to generate a log file for the last action. can you suggest me a way to achieve this.Question: If I execute the rsync command with -v flag, it will print a lot of messages on the console. Is there any way. So, I can redirect these logs to a file?

View 4 Replies View Related

General :: Read Three Files And Print Output In A New File?

Sep 9, 2010

file1: have DNA sequences and each sequence will begin with > symbolfile2: have protein sequence and each sequence will start with > symbolfile3: BLAST result of file2 and each result will start with query= .my problem is i have to make a report file by combining these three in such way that first sequence from file1,first sequence from 2nd file and first result from file3 should be printed in a report file

View 14 Replies View Related

General :: Redirecting Output Of Set -x?

Mar 16, 2011

I have written a script and included the command

Code:
set -x
to see what happening when i run the script

View 7 Replies View Related

Ubuntu Installation :: Input/output Error Message, No Sound, Screen Resolution?

Mar 5, 2010

I cant seem to install Ubuntu 9.10 at all. At 15% I get the following Error Message Input/output Error During Read On/dev/sda then I get the creation of swapspace in partition #5 of SCSI1(0,0,0) (SDA) Failed. Ive tried 6 times already. Im getting no sound at all. How can I change the screen resolution. 800 x 600 is the highest it will go. Im getting really discouraged with Ubuntu. Alot of people seem to have the same problems I am having but there is no solutions. I've checked the MEMTEST and passed, done a disk check and passed.

View 9 Replies View Related

Hardware :: Redirecting ALL Audio Output?

Jan 15, 2011

So I have a DAC/Headphone Amplifier which plugs in through USB. Through the system settings I'm able to set it as the preferred audio output option. This makes all the windows manager sounds come through the headphones, but all the applications still come through the laptop speakers; i guess they are completely independent of the system settings. I have to set each application's output preferences separately, and some software (like Firefox) doesn't have any output preferences. So is there a way toirect the audio output of all applications to all come through the USB DAC

View 4 Replies View Related

General :: Redirecting Output From Stderr?

Dec 1, 2010

I have seen a post where someone was explaining the virtuality of stdout and stderr and that it can be redirected with e.g. 2>file.txt but this apparently is not working for me!
I have a CUPS filter with fprintf(stderr,...)

View 5 Replies View Related

General :: Redirecting Output From A Command Using Bash?

May 10, 2011

I would like to get the command and it's output redirected i have tried using the below but my syntax seems to be incorrect .

<<EOF
$(ls)
EOF

View 2 Replies View Related

Server :: Redirecting Output Of 'sendmail -bv' To Console?

May 3, 2011

When I run 'sendmail -bv', it sends the mail delivery status report as a mail to the root. Is there a way I can redirect this to the console instead of sending as a mail. requirement is to programatically find the mail host of the recipient for which I thought of using this 'sendmail -bv' command. Is there any other better way to find mail host of the recipient

View 12 Replies View Related

Ubuntu Multimedia :: Redirecting Pulseaudio Output Without Padevchooser

Jul 30, 2011

Today I tried to use padevchooser on Natty to send my laptop audio to my home media machine (which has the good speakers) using the "default server" option. Turns out padevchooser doesn't work on Unity and the threads I have seen say it is deprecated for other gui tools,

So what is the easy gui way to switch from my local pulse server to another one on my LAN, without using padevchooser, or switching off Unity? Or is this a regression?

View 2 Replies View Related

Ubuntu :: Redirecting Output From Printf Statement In C Program

May 22, 2010

I've got a C program that I've added some 'printf' statements to monitor a couple of variables. When I run this program manually or from a script, the output is displayed on screen. However, I need to change various variables in the 'test.c' file, run 'make clean' and 'make' a few hundred thousand times. I'm using a script to read the variables in and then using sed to do in-place edits of the file. Unfortunately, with this amount of iteration, it is getting rather tired!

Anyway, I've created a script that is working as long I respond to prompts. I've tried the following to no avail: Code: /path/to/script > /tmp/output /path/to/script > /tmp/output 2>&1 /path/to/script | tee (no output even after adding the -a option) In my C program, I have the following 'printf' statement: Code: printf ("variable1: $s variable2: $s",var1,var2); What am I missing? I've worked with redirection before and it's always worked out fine, but this one plain stumps!

View 2 Replies View Related

Programming :: Socket Programming While Displaying Received Message In File

May 11, 2011

i have problem in socket programming, while displaying received message in file,i got a problem... i cant able to write it in the file.... this is the code....

Code:
/* tcpserver.c */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
[Code]....

now my problem is run time error i can able to create file but i cant able to write file....log.txt contain nothing.... as here i have give sample code... dont say not initialising function and all.... i have initialised , please only see func1() - my problem is only not able to write msg which i got received from the client..

View 2 Replies View Related

Programming :: Print A Value To A File ?

Apr 12, 2010

I have this code:

How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.

View 8 Replies View Related

Programming :: Print A Single Digit Integer On To The Screen Using The Int 0x80?

Jul 4, 2010

I want to print a single digit integer on to the screen using the int 0x80. I have loaded the number in the ecx(=5, say), size in edx (=4, lenght) and eax (=4) ebx (=1). I've added 48 to the contents of ecx, and then calling int 0x80, I thought should print 5 on the screen.

However it does not print anything. also gives no errors. I checked the contents of the ecx reg (gdb), it has 53.

A snippet showing the this will be great. I've seen snippets using the c library (printf), but I want to see how it is done using int 0x80.

View 9 Replies View Related

Applications :: Saving Postscript Output - How To "print To File"

Mar 21, 2010

Been using gv and vi to build a postscript file. Now I would like to save the output of the program to a disk file. My problem is I can't figure out how to "print to a file".

View 2 Replies View Related

Programming :: Print File Name In BASH

Feb 26, 2009

I want to write a script that returns me name of the files that begin with the specified characters. like

Script out should be

View 3 Replies View Related

Ubuntu :: Print Screen When Hovering Over File Menu?

Feb 16, 2011

I'm making some instructions for colleagues at work. I want to add printscreen shots of the steps involved. I'm unable to capture the screen to the clipboard when I am hovering over, say, the 'File -> Menu'.

View 6 Replies View Related

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

Programming :: Sed - Save Output To File With Filename From Content Of Another File?

Feb 28, 2011

My employer issues pdf files with everyones work schedules. I copy the content and save it as plain text in a file called unformatted (hope to be able to automate this step someday). Im working on a SED script that reduces unformatted to only display what I want to see and saves the result in a file Iïve named formatted. After that I have to manually copy formatted and save it with that days date as a filename e.g. 2011-02-25 or whatever day is scheduled in the pdf, for use on a mobile device (Nokia N900). I noticed that the date occurs on certain lines in the file so I added a line like:

sed -n 's/^Date: (201[1-9])/([0-1][0-9])/([0-3][0-9]).*/1-2-3/p' < unformatted >theDate
That creates a file theDate with the date in it that I wish to use as the filename for this particular instance. So I would like to skip the file formatted all together and have the sed- script write to a new file using the content of the Date as a filename, but how do I make that happen? And of course it would be more elegant if I could skip the intermediate theDate file as well.

View 4 Replies View Related







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