[Thread Prev][Thread Next][Index]

Re: [ferret_users] create go files on the fly



Hi David

One idea, the redirection ">" will not work if you have 'noclobber' set and a blank file 'tmp.jnl' already exists

So try ">!"  instead to force overwrite of the file.

Cheers
Simon

On 22/08/2008, at 6:31 AM, David Wang wrote:

Hi Ferreters,

I have a script in which a chunk of code is used several times, so I copied and pasted it into several different places. Then I thought, well, maybe I can shorten my script by wrapping that chuck of code in an additional go file, and if possible, on the fly. So I tried the following,

sp cat << EOF > tmp.jnl

my code here

EOF

go tmp.jnl
...
go tmp.jnl
...
...
sp rm -f tmp.jnl

But it doesn't work. The lines in between two EOF didn't find themselves in the file tmp.jnl. Has anyone done similar tricks before? I really like the idea of creating files on the fly...

Thanks,
David




[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement