Sponsored Content
Full Discussion: awk file redirection issue
Top Forums Shell Programming and Scripting awk file redirection issue Post 303009264 by Corona688 on Monday 11th of December 2017 03:23:25 PM
Old 12-11-2017
Thanks, that workaround works great. Just one of those weird syntax corners it seems.
 

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

awk two file redirection

Hi, i use awk -F to print three variable delimited by comma $1 $2 $3 if $2=="" i want to extract this information missing from another file using awk -v + some process. but the problem i can't use the two awk together cause of redirection there's a solution. note: i can't use another... (1 Reply)
Discussion started by: kamel.seg
1 Replies

3. Shell Programming and Scripting

awk print redirection to variable file name

Hello, i need to redirect the output of print to a variable file name: #This is normal awk '{ print $17 > "output.txt" }' input #I need something like this awk '{ print $17 > "output_${25}.txt" }' input how to format the output file name to contain a variable? (6 Replies)
Discussion started by: nazeeb
6 Replies

4. Shell Programming and Scripting

Error with redirection in awk

I'm trying to find average of values in 2nd column in some files. Filenames have following pattern eg: tau_2.54_even_v1.xls tau_2.54_odd_v1.xls tau_1.60_v1.xls tau_800_v1.xls #!/bin/bash for file in pmb_mpi tau xhpl mpi_tile_io fftw ; do for f in "2.54" "1.60" "800" ;do if... (2 Replies)
Discussion started by: vishwamitra
2 Replies

5. Shell Programming and Scripting

awk output redirection to file

I have a system stat command running which generates data after 5 sec or so. I pass this data to awk and do some calculation to present the data differently. Once done now I want to pass this data to file as and when generated but doesn't work..unless the first command completes successfully.... (6 Replies)
Discussion started by: learnscript
6 Replies

6. Shell Programming and Scripting

awk redirection

Hi everyone i am facing a very strange problem . see below is my code #awk <do something> file 1 > file2 Now the problem is whenever i am redirecting the output to file2 it creates the file2 but of 0 size. i don't know what is the reason but it is very important to me to redirect the... (11 Replies)
Discussion started by: aishsimplesweet
11 Replies

7. Shell Programming and Scripting

Issue with output redirection

Hi, I am using AIX server. I have a korn shell script where in I am redirecting a line to a file in a while loop: while read line do outputline=$line; echo $outputline >> "./temp/exec_list_"$ETL_JOB_RUN"_temp" done < ./temp/exec_list_$ETL_JOB_RUN Sometimes, when the CPU... (2 Replies)
Discussion started by: pmonika
2 Replies

8. UNIX for Dummies Questions & Answers

little problem of file redirection (awk)

I almost reach my objective (Youhouuu !!!!) But I really don't understand why it doesn't work until the end... :wall: For clarity's sake I am taking a very simple example. The operations I am doing in the script (gsub and print) really don't have any importance !!! I just matter about... (10 Replies)
Discussion started by: beca123456
10 Replies

9. Shell Programming and Scripting

awk issue while reading from file in while do

Hi Friends, I am trying to scan line by line using awk and pull the values and pass it in variables and then will use the variables but doesn't work. Please see below for details. #more dbtest.sh ---------------------------------- #!/bin/bash . $HOME/.bash_profile while read line do... (6 Replies)
Discussion started by: narunice
6 Replies

10. Shell Programming and Scripting

awk to place value at 24 field in a flat file issue

I am trying to add 0393 value at 24th feild using the below command, but its adding at all the lines including header and trailer Input file: ZHV|2657|D0217001|T|TXU|Z|PAN|20131112000552||||OPER| 754|52479| 492|489|SP40|1014570286334|20131111|20131201|14355334|CHAMELON... (1 Reply)
Discussion started by: Aditya_001
1 Replies
IMAGESETPIXEL(3)							 1							  IMAGESETPIXEL(3)

imagesetpixel - Set a single pixel

SYNOPSIS
bool imagesetpixel (resource $image, int $x, int $y, int $color) DESCRIPTION
imagesetpixel(3) draws a pixel at the specified coordinate. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $x - x-coordinate. o $y - y-coordinate. o $color - A color identifier created with imagecolorallocate(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 imagesetpixel(3) example A random drawing that ends with a regular picture. <?php $x = 200; $y = 200; $gd = imagecreatetruecolor($x, $y); $corners[0] = array('x' => 100, 'y' => 10); $corners[1] = array('x' => 0, 'y' => 190); $corners[2] = array('x' => 200, 'y' => 190); $red = imagecolorallocate($gd, 255, 0, 0); for ($i = 0; $i < 100000; $i++) { imagesetpixel($gd, round($x),round($y), $red); $a = rand(0, 2); $x = ($x + $corners[$a]['x']) / 2; $y = ($y + $corners[$a]['y']) / 2; } header('Content-Type: image/png'); imagepng($gd); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagesetpixel() SEE ALSO
imagecreatetruecolor(3), imagecolorallocate(3), imagecolorat(3). PHP Documentation Group IMAGESETPIXEL(3)
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy