[Thread Prev][Thread Next][Index]

Re: [ferret_users] vertical and horizontal lines in ps images



Hi Steve,

This is off topic of Ferret per se, but I thought it might be helpful
to some people:

| #! /bin/tcsh

You usually want "/bin/tcsh -f".  For example, with "-f", you don't
need "\" in "\mv" below.

| ferret -unmapped -script fourier.jnl
| set file = `echo *.plt | cut -d"." -f1 `

There is a command (on any Unix or Linux) called basename for this
very purpose:

  set file = `basename metafile.plt .plt`

| # script to increase line weights of Ferret output
| sed 's_3.000000 lw_6.000000 lw_g' < $file.ps >! foo; \mv foo $file.ps
| sed 's_2.000000 lw_4.000000 lw_g' < $file.ps >! foo; \mv foo $file.ps
| sed 's_1.000000 lw_2.000000 lw_g' < $file.ps >! foo; \mv foo $file.ps

sed can accept multiple commands (separated by commas) at a time,
which will simplify your script:

  sed 's_3.000000 lw_6.000000 lw_g;s_2.000000 lw_4.000000 lw_g;s_1.000000 lw_2.000000 lw_g' < $file.ps >! foo; \mv foo $file.ps

Further, the "in place" option of sed obliterates the need for
creating a temporary file:

  sed -i 's . . . g' $file.ps

overwrites the input file, so that you don't have to create the
temporary file "foo" or to "mv" it over the original file.

Regards,
Ryo


[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement