Hello Forum,
I work under linux kernel 2.6.20-1.2320.fc5
I wrote an awk script (named prim_fail) for generating a sequence of draws from a binomial distribution:
I run the script as follows:
$ awk -f prim_fail > sim_sheet
After entering the command, I press "return" (cursor jumps to the next line) , but I need to press "return" again to get to the shell prompt again. This is not convenient when running this awk script from within a python script loop, because for every iteration I need to press the "return" key.
Can anyone give me a tip how to avoid pressing "enter" manually? It seems that this problem does not occur when awk gets data from a file: The problem occurs when the data generated by awk are written to a newly created file.
Thank you,
pter
I work under linux kernel 2.6.20-1.2320.fc5
I wrote an awk script (named prim_fail) for generating a sequence of draws from a binomial distribution:
Code:
BEGIN {
srand()
}
{ for(i=1;i<=100;i++)
{ if (rand()<0.2)
print $1=1
else
print $1=0
}
exit
}
I run the script as follows:
$ awk -f prim_fail > sim_sheet
After entering the command, I press "return" (cursor jumps to the next line) , but I need to press "return" again to get to the shell prompt again. This is not convenient when running this awk script from within a python script loop, because for every iteration I need to press the "return" key.
Can anyone give me a tip how to avoid pressing "enter" manually? It seems that this problem does not occur when awk gets data from a file: The problem occurs when the data generated by awk are written to a newly created file.
Thank you,
pter