Sponsored Content
Top Forums Shell Programming and Scripting AWK Too many open streams to print/printf Post 302624779 by zvtral on Monday 16th of April 2012 09:52:17 PM
Old 04-16-2012
AWK Too many open streams to print/printf

hallow all i need your advice about this script

i have script like this:
Code:
INDEX=/zpool1/NFS/INDEX/${1}
SCRIPT=/zpool1/NFS/script/${1}
LIST=SAMPLE

cd ${SCRIPT}
for i in `cat ${LIST}`
do
GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'`
/usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >> "'${INDEX}/${GETDATE}/LIST_'"f".TCG"}' ${INDEX}/${i}
rm -f ${INDEX}/${i}
done
rm -f ${LIST}

if i run this code in linux in never get error but if i run this in solari
get output error like this
Code:
/usr/xpg4/bin/awk: line 0 (NR=302): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_262.TCG"
/usr/xpg4/bin/awk: line 0 (NR=301): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_304.TCG"
/usr/xpg4/bin/awk: line 0 (NR=291): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_110.TCG"
/usr/xpg4/bin/awk: line 0 (NR=284): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_054.TCG"
/usr/xpg4/bin/awk: line 0 (NR=294): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_921.TCG"
/usr/xpg4/bin/awk: line 0 (NR=285): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_607.TCG"
/usr/xpg4/bin/awk: line 0 (NR=302): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_667.TCG"
/usr/xpg4/bin/awk: line 0 (NR=302): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_636.TCG"
/usr/xpg4/bin/awk: line 0 (NR=299): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_144.TCG"
/usr/xpg4/bin/awk: line 0 (NR=332): too many open streams to print/printf onto "/zpool1/NFS/INDEX/iq04/20120406/LIST_815.TCG"

Smilie
so how i can run this script without error like above
i need your advice for my script to be running well

Last edited by zvtral; 07-31-2012 at 03:46 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print a % within a printf() function using awk

Here is the code I'm using { printf("%11d %4.2f\% %4.2f\%\n", $1,$2,$3); } I want the output to look something like 1235415234 12.24% 52.46% Instead it looks something like 319203842 42.27\%4.2f\% How do I just print a "%" without awk or printf thinking I'm trying to do... (1 Reply)
Discussion started by: Awanka
1 Replies

2. Shell Programming and Scripting

awk and printf

echo $bbsize 1.5 echo $fillpercent .95 echo $bbsize | awk '{printf "%.2f\n",$0*$fillpercent}' 2.25 echo $bbsize | awk '{printf "%.2f\n",$0*.95}' 1.42 1.42 is what I'm expecting... echo $blocksize 4096 echo $bbsize | awk '{printf "%.2f\n",$0*$blocksize}' 2.25 echo $bbsize |... (3 Replies)
Discussion started by: xgringo
3 Replies

3. Shell Programming and Scripting

IF and awk/printf

Hi Friends, Scripting newb here. So I'm trying to create a geektool script that uses awk and printf to output certain fields from top (namely command, cpu%, rsize, pid and time, in that order). After much trial and error, I've pretty much succeeded, with one exception. Any process whose name... (3 Replies)
Discussion started by: thom.mattson
3 Replies

4. Shell Programming and Scripting

AWK printf help

Target file contains short text (never more than 1 line) and filenames. The format is, e.g.,: TEXT1 filename1 TEXT2 TEXT3 filename3dddd filename3dddd TEXT4 filename4 TEXT5 filename5dddd filename5dddd filename5 where dddd is a random 4-digit whole number. Desired output: (4 Replies)
Discussion started by: uiop44
4 Replies

5. Shell Programming and Scripting

How to print a string using printf?

I want to print a string say "str1 str2 str3 str4" using printf. If I try printing it using printf it is printing as follows. output ------- str1 str2 str3 str4 btw I'm working in AIX. This is my first post in this forum :) regards, rakesh (4 Replies)
Discussion started by: enigmatrix
4 Replies

6. Shell Programming and Scripting

awk with printf

Hi, I am using the following code to assign a count value to a variable. But I get nothing. Do you see anything wrong here. I am new to all this. $CTR=`remsh $m -l $MACHINES{$m} -n cat $output | grep -v sent | grep \"$input\" | sort -u | awk '{print $5}'`; Upto sort - u it's... (2 Replies)
Discussion started by: nurani
2 Replies

7. Shell Programming and Scripting

What's the difference between print and printf in command?

For example, in this command: ls /etc/rc0.d/ -print ls /etc/rc0.d/ -printfThe outputs are quite different, why? (7 Replies)
Discussion started by: Henryyy
7 Replies

8. Shell Programming and Scripting

How to combine print and printf on awk

# cat t.txt 2,3,4,5,A,2012-01-01 00:00:28 2,6,4,5,A,2012-01-02 00:00:28 2,7,4,5,A,2012-01-02 02:00:28 # awk -F"," '{OFS=",";print $2,"";printf("%s", strftime("%m%d%y",$6));printf("%s", strftime("%H%M%S \n",$6));print ("",$1)}' t.txt 3, 010170073332 ,2 6, 010170073332 ,2 7,... (3 Replies)
Discussion started by: before4
3 Replies

9. Programming

[Perl] Different printf formating for different print options

Hi, Struggling with single quotes, double quotes, etc. I want to print a header line, followed by lines with actual values, based on a print option. In real life it is going to be something like 15 print options and 50 values. Output will be 1 header and several value lines. In this example... (5 Replies)
Discussion started by: ejdv
5 Replies

10. Shell Programming and Scripting

Combining awk printf and print strftime command

I have a lines like below, captured from rrdtool fetch command, 1395295200 2.0629986254e+06 7.4634784967e+05 1395297000 2.0198121616e+06 6.8658888903e+05 1395298800 1.8787141122e+06 6.7482866452e+05 1395300600 1.7586118678e+06 6.7867977653e+05 1395302400 1.8222762151e+06 7.1301678859e+05I'm... (3 Replies)
Discussion started by: rk4k
3 Replies
script(1)						      General Commands Manual							 script(1)

NAME
script - Makes a transcript of terminal session SYNOPSIS
script [-a] [file] The script command makes a transcript of everything printed on your terminal. OPTIONS
Appends the transcript to file rather than writing it to file. OPERANDS
The name of an output file that will contain the transcript of the session. If this parameter is omitted, the file typescript is written. DESCRIPTION
The transcript is written to file, or appended to file if the -a option is given. If no file name is given, the transcript is saved in the file typescript. The script ends when the forked shell exits. This program is useful when you are using a CRT and want a hard-copy record of the dialog (for example, a technical writer might create an example of a working session this way). If you specify the -a option and the file does not exist, it is created. If you do not specify the -a option and the file exists, it is replaced. RESTRICTIONS
The script command requires a streams based terminal. In single user mode, streams may not be enabled. Under these circumstances, script will exit with no action. If you are the superuser and need to run this command in single user mode, use the following special instruc- tions. Enabling Streams If it is necessary to enable a streams environment in the single user mode, enter the command /sbin/init.d/streams. This command is avail- able to the superuser only. SEE ALSO
Commands: autopush(8), cat(1), echo(1), strsetup(8), tee(1) System Administration script(1)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy