Sponsored Content
Top Forums Shell Programming and Scripting How do I feed numbers from awk(1) to tail(1)? Post 302181282 by unilover on Wednesday 2nd of April 2008 02:25:45 PM
Old 04-02-2008
Sorry! "zcat|touch" preou* was in my test!!

You should have "begin|end" mymail.txt
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tail -f, awk and redirection

I want to run tail -f to continuously monitor a log file, outputing a specific field to a second log file. I can get the first portion to work with the following command: tail -f log | awk '{if ($1 == "Rough") print $5}' also: awk '{if ($1 == "Rough") print $5}' <(tail -f log) The... (2 Replies)
Discussion started by: mfajer
2 Replies

2. Shell Programming and Scripting

replace last form feed with line feed

Hi I have a file with lots of line feeds and form feeds (page break). Need to replace last occurrence of form feed (created by - echo "\f" ) in the file with line feed. Please advise how can i achieve this. TIA Prvn (5 Replies)
Discussion started by: prvnrk
5 Replies

3. Shell Programming and Scripting

Extract URL from RSS Feed in AWK

Hi, I have following data file; <outline title="Matt Cutts" type="rss" version="RSS" xmlUrl="http://www.mattcutts.com/blog/feed/" htmlUrl="http://www.mattcutts.com/blog"/> <outline title="Stone" text="Stone" type="rss" version="RSS" xmlUrl="http://feeds.feedburner.com/STC-Art"... (8 Replies)
Discussion started by: fahdmirza
8 Replies

4. Shell Programming and Scripting

AWK / tail Issue

Hello, I am using a tail command to fetch the line before last in a log file. the two last lines are as followed: 11-01-16 11:55:45.174 | CClientObject::InitTraceLevelInCache Starting CClientObject::InitTraceLevelInCache End I am doing a awk statement to gather only the numeric... (1 Reply)
Discussion started by: LiorAmitai
1 Replies

5. Shell Programming and Scripting

awk remove line feed

Hi, I've this file: 1, 2, 3, 4, 5, 6, I need to remove the line feed LF every 3 row. 1,2,3, 4,5,6, Thanks in advance, Alfredo (5 Replies)
Discussion started by: alfreale
5 Replies

6. Shell Programming and Scripting

Unix, awk to read .ksh feed

I need some advice, I have live feed containing xml messages which means there is new messages every minute. I need a script that will run every 2 hours using the current time minus 2 hours ( which I able to do) However I have problem with the date formatting i.e. One date is... (3 Replies)
Discussion started by: INHF
3 Replies

7. Shell Programming and Scripting

awk for replacing line feed

Hello all, I have data like "1"|"My_name"|"My_Email"|"My_Last"|My_other" "2"|"My_name"|"My_Email"|"My_Last"|My_other" "3"|"My_name"|"My_Email"|" "|My_other" "1"|"My_name"|"My_Email"|"My_Last"|My_other" Need output like "1"|"My_name"|"My_Email"|"My_Last"|My_other"... (10 Replies)
Discussion started by: lokaish23
10 Replies

8. Shell Programming and Scripting

awk issue splitting a fixed-width file containing line feed in data

Hi Forum. I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type. The main command in the script is: awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Discussion started by: pchang
8 Replies

9. UNIX for Beginners Questions & Answers

awk Command to add Carriage Return and Line Feed

Hello, Can someone please share a Simple AWK command to append Carriage Return & Line Feed to the end of the file, If the Carriage Return & Line Feed does not exist ! Thanks (16 Replies)
Discussion started by: rosebud123
16 Replies

10. UNIX for Beginners Questions & Answers

Shell script to tail a file with unknown numbers

Hello, I would like to write script to tail a file for different environment But the number of lines are keep changing How can I write a script For example: env could : A, B or C and log files could be a.log, b.log and c.log with the number of lines can change say sometimes it 100 last... (9 Replies)
Discussion started by: encrypt_decrypt
9 Replies
Commands Reference, Volume 6, v - z

zcat_Command

  Purpose

   Expands a compressed file to standard output.

  Syntax

   zcat [  -n ] [  -V ] [  File ... ]

  Description

   The	zcat  command  allows  the user to expand and view a com-
pressed file
   without uncompressing that file. The zcat command does not re-
name the
   expanded  file  or  remove  the .Z extension. The zcat command
writes the
   expanded output to standard output.

  Flags

   -n	 Omits the compressed file  header  from  the  compressed
file.
   -V	  Writes the current version and compile options to stan-
dard error.

  Parameters

   File ...		Specifies the compressed files to expand.

  Return Values

   If the zcat command exits with a status of 1  if  any  of  the
following
   events occur:

     * The input file was not produced by the compress command.
     *	An  input file cannot be read or an output file cannot be
written.

   If no error occurs, the exit status is 0.

  Exit Status

   0			       Successful completion.
   >0			       An error occurred.

  Examples

   To view the foo.Z file without uncompressing it, enter:

	 zcat foo.Z

   The uncompressed contents of the foo.Z  file  are  written  to
standard
   output. The file is not renamed.

  Related Information

   The compress command, pack command, uncompress command,
   unpack command.

   Commands in Operating system and device management.

________________________________________________________________________________

		      Commands Reference, Volume 6, v - z

zcat_Command

  Purpose

   Expands a compressed file to standard output.

  Syntax

   zcat [  -n ] [  -V ] [  File ... ]

  Description

   The zcat command allows the user to expand  and  view  a  com-
pressed file
   without uncompressing that file. The zcat command does not re-
name the
   expanded file or remove the .Z  extension.  The  zcat  command
writes the
   expanded output to standard output.

  Flags

   -n	  Omits  the  compressed  file header from the compressed
file.
   -V	 Writes the current version and compile options to  stan-
dard error.

  Parameters

   File ...		Specifies the compressed files to expand.

  Return Values

   If  the  zcat  command  exits with a status of 1 if any of the
following
   events occur:

     * The input file was not produced by the compress command.
     * An input file cannot be read or an output file  cannot  be
written.

   If no error occurs, the exit status is 0.

  Exit Status

   0			       Successful completion.
   >0			       An error occurred.

  Examples

   To view the foo.Z file without uncompressing it, enter:

	 zcat foo.Z

   The	uncompressed  contents	of  the foo.Z file are written to
standard
   output. The file is not renamed.

  Related Information

   The compress command, pack command, uncompress command,
   unpack command.

   Commands in Operating system and device management.
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy