[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to handle "remove ferret.jnl* ? [Y] :" in unix? ferret v6.72



Hi all -

This might be a good time to recall an old post from 2005 (that was itself recycled from 2000), giving some hints as to how to work with the journal files - and by implication, why it is a good idea to keep them.

Billy K
----------------------------------------------------
From 2 March 2005:

 You might want to consider how useful those journal files can be.
I refer to mine often. For example, suppose you have a gif file
made years ago, and want to duplicate it. Searching the .jnl files
for that filename will quickly find the exact series of commands
that produced the image. Or that created a particular netcdf file.
Or many other things. This saves many hours of work, and it is
work that is especially frustrating because it has already been
done once.

It is true that having lots of these files can clutter up a directory.
However, there is an easy solution for that, and I have several other
tools that make these files more easily accessed. I have pasted below
a message I sent to this list 5 years ago, that might be worth repeating:

1. In any directory from which you want to run ferret, make
  a subdirectory "fjnl". (This step can easily be automated)

2. On starting ferret, execute a startup file that consists
  of the following 2 lines:

set mode journal fjnl/ferret.jnl
sp ls -t1 fjnl/* | head -2 | tail -1

This sets the session to write to the fjnl directory, and echoes
the number of the most recent ferret.jnl file there. The result
is that all my jnl files are conveniently at hand, but do not clutter
up my working directories.

(To automate this, place the above 2 lines in a file called startup.go,
in a directory listed in your FER_GO paths, then type "go startup.go"
immediately when you start Ferret. To make this even simpler, create
a file ".ferret" in your home directory that lists aliases defined
whenever Ferret is started. Include the line "alias start go startup.go"
(no quotes), and then just type "start" in your Ferret session).

3. Define (unix/tcsh) aliases for the following:

alias txjnl 'tx fjnl/ferret.jnl.~\!*~' (tx points to my text editor)
alias wcjnl       'wc fjnl/ferret.jnl.~\!*~'
alias grepjnla    'grep \!* fjnl/*'
alias grepjnln    '/home/pontus/kessler/ferret/grepjnl.com'
where the [executable] file grepjnl.com consists of the single line:
     grep -i $1 fjnl/ferret.jnl.~$2~

These aliases allow easy working with the jnl files.

For example, suppose I want to know how I made the gif file filename.gif:

> grepjnla filename.gif

That tells me which jnl file made it (say it was ferret.jnl.~233~).
Now I can see what variables I defined in that session:

> grepjnln let 233

Perhaps I want to bring up that file in a text editor for pasting into a
current session. But first it might be useful to know how many lines it has:

> wcjnl 233   ! how many lines are in the jnl file
> txjnl 233   ! open the jnl file in a text editor

And so on. These things make it really easy to work with jnl files, and
reduce clutter and I never would have the need to give a command like
rm *.jnl.

Billy K





Date: Wed, 2 Mar 2005 14:33:34 -0500 (EST)
From: Ming Yang <myang@xxxxxxxxxxxxx>
To: ferret_users@xxxxxxxx
Subject: Can I get rid of ferret.jnl?

Hi,
  Every time I run ferret, I will got a "ferret.jnl" file after I exit
it. How can I get rid of it automatically? I am tired of deleting it by
hand every time I finish using ferret.

Ming



On Nov 4, 2011, at 11:48 AM, Ansley Manke wrote:

Hi Jimmy,
Removing ferret.jnl is not part of Ferret commands. Is there a command inside your jnl file to spawn out and remove ferret.jnl? For Fpurge, if there are several files such as ferret.jnl.~1~, ferret.jnl.~2~, then from the Unix command line,

% Fpurge ferret.jnl

will delete all of the ones that have the ~ extension.

Ansley

On 11/4/2011 1:15 AM, 金懐東(Jimmy Kin) wrote:

Dear all,

when I run my .jnl file in unix with "-script" to draw figs, it will show "remove ferret.jnl* ? [Y] :" every time after "LISTing to file *.cdf". I also tried "Fpurge ferret.jnl" with my -sh file, but it didn't work.

How could I do if i don't need it showing in my command window?

Thank you in advance!



--
━━━━━━━━━━━━━━━━━━━━━━━
金懐東 (Jimmy Kin)
Yamaguchi Research Laboratory Master Course
Department of Ocean Technology, Policy and Environment
Graduate School of Frontier Sciences
The University of Tokyo
E-mail : jimmyandone@xxxxxxxxx
TEL     : +81-80-4440-8606
━━━━━━━━━━━━━━━━━━━━━━━





[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement