Sponsored Content
Top Forums Shell Programming and Scripting Problem with writing to output - awk, echo Post 302716545 by pamu on Tuesday 16th of October 2012 02:41:47 PM
Old 10-16-2012
Quote:
Originally Posted by @man
Thanks man. But now it doesn't give me the $REGION in output. Since you put it before wc whatever it write it just counts the line after pipe. now the output is just the calcs.
I think writing the regions should be after wc -l or maybe we should think to count the lines in another way... I don't know! :\
Yeah just corrected the code. Please check now..Smilie
This User Gave Thanks to pamu For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Writing to a file without echo it to the console !!!!

hi all, I am trying to write some message to a file using the following command. echo "${MESSAGE}" >&1 | tee -a ${File_name} can the same be done without using echo . I don't want the result to be displayed to the console. Can anyone guide me. Thanks in advance (6 Replies)
Discussion started by: amit_kv1983
6 Replies

2. Shell Programming and Scripting

Writing output into different files while processing file using AWK

Hi, I am trying to do the following using AWK program. 1. Read the input data file 2. Parse the record and see if it contains errors 3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies

3. Shell Programming and Scripting

problem with suppressed output to file using echo and tee command

Hi, When I run the following command in terminal it works. The string TEST is appended to a file silently. echo TEST | tee -a file.txt &>/dev/null However, when I paste this same line to a file, say shell1.sh, and use bourne shell . I run this file in terminal, ./shell1.sh. However I... (1 Reply)
Discussion started by: shahanali
1 Replies

4. UNIX for Dummies Questions & Answers

awk output problem

Hi Gurus, I have a file which has some fields separated with multiple spaces or single space. data 1 2 3 4 5 6 4 5 5 7 7 8 9 4 6 10 and so on..... The problem I am facing is the output of the awk program... (2 Replies)
Discussion started by: sanjay.login
2 Replies

5. Shell Programming and Scripting

Writing html to a file with echo

Hi, I'm having an issue with echo again. I keep getting errors and no file content with these commands in a script. --------------------------------------------------- #!/bin/bash WEBSITE=http://www.google.com touch test1.txt echo "replace("<body>","<body><iframe... (2 Replies)
Discussion started by: digitalviking
2 Replies

6. Shell Programming and Scripting

Problem with output awk and sed

I have file, i am extracting email address from file. but problem is that output is very ugly. I am using this command REMOVED "CSS OFFENDING CODE"... While original filename have no such character. Please suggest. (20 Replies)
Discussion started by: learnbash
20 Replies

7. Shell Programming and Scripting

awk print output problem

Hello friends, I have written a script and i need to add some part into it so that i could print out more results depending on more conditions, This is the core part of the script which does the actual work: echo "$j" && nawk -v stat=$2 'NR==FNR &&... (1 Reply)
Discussion started by: EAGL€
1 Replies

8. Shell Programming and Scripting

Echo awk output from its variable

Stumped with the formatting of the awk output when used with variables, e.g.: awk -F, 'BEGIN {OFS=","} print {$2,$3,$4}' $infile1 produces the desired output (with rows), but when echoing the variable below, the output is one continuous line var1=$(awk -F, 'BEGIN {OFS=","} print... (4 Replies)
Discussion started by: ux4me
4 Replies

9. Shell Programming and Scripting

Grep echo awk print all output on one line

Hello, I've been trying to find the answer to this with Google and trying to browse the forums, but I haven't been able to come up with anything. If this has already been answered, please link me to the thread as I can't find it. I've been asked to write a script that pulls a list of our CPE... (51 Replies)
Discussion started by: rwalker
51 Replies

10. UNIX for Beginners Questions & Answers

Need to save output of echo and awk to a file

Hi, I am generating a YAML file from a hosts file, but am having trouble saving it to a new file. hosts file 127.0.0.1 localhost 192.168.1.2 host1 192.168.1.3 host2 192.168.1.4 host3 192.168.1.5 host4 YAML file $ echo 'host_entries:' && awk '{printf " %s:\n ip:... (3 Replies)
Discussion started by: sand1234
3 Replies
REDIFF(1)																 REDIFF(1)

NAME
rediff, editdiff - fix offsets and counts of a hand-edited diff SYNOPSIS
rediff ORIGINAL EDITED rediff EDITED rediff {--help | --version} editdiff FILE editdiff {--help | --version} DESCRIPTION
You can use rediff to correct a hand-edited unified diff. Take a copy of the diff you want to edit, and edit it without changing any off- sets or counts (the lines that begin ``@@''). Then run rediff, telling it the name of the original diff file and the name of the one you have edited, and it will output the edited diff file but with corrected offsets and counts. A small script, editdiff, is provided for editing a diff file in-place. The types of changes that are currently handled are: o Modifying the text of any file content line (of course). o Adding new line insertions or deletions. o Adding, changing or removing context lines. Lines at the context horizon are dealt with by adjusting the offset and/or count. o Adding a single hunk (@@-prefixed section). o Removing multiple hunk (@@-prefixed sections). Alternatively, if only one argument is provided, it is taken to be the edited file and the counts and offsets are adjusted as appropriate. Some assumptions are made when used in this mode. See recountdiff(1) for more information. OPTIONS
--help Display a short usage message. --version Display the version number of rediff. SEE ALSO
interdiff(1), recountdiff(1) AUTHOR
Tim Waugh <twaugh@redhat.com>. patchutils 13 May 2002 REDIFF(1)
All times are GMT -4. The time now is 02:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy