How to print based on the value from counters?

Hi,

I am writing a script which will get the input from a combinations of awk commands and using counters and loop I am generating a dynamic values and passing the output to a file using print -u3 options, now instead of redirecting the output to a file how can the output be created in the same script file.

Regards,
Shruthi

What do you mean by 'created in the same script file'?

Hi,

I am generating some delete and insert sqls dynamically and I am redirecting them to a file in \execute\sqls\ through print -u3, now instead of redirecting to a file can i print the insert's and deletes after the awk and counters command.

I am trying to avoid one step by eliminating the redirection to a new file and creating the same output in the executing script, is it possible?

Regards,
Shruthi

Quite probably.

If it helps, you can combine statements with ( ) so you can pipe the output of multiple commands, in order, through one pipe.

( echo a ; cat b ; foo ) | command

If this doesn't clear it up you may actually need to post your code so we can see what you need specifically.