[Thread Prev][Thread Next][Index]

Re: Can I get rid of ferret.jnl?



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 that 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".

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 tells
me 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) 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William S. Kessler
NOAA / Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle Wa 98115 USA

NOTE NEW E-MAIL ADDRESS -->> William.S.Kessler@noaa.gov 

Tel: 206-526-6221 
Fax: 206-526-6744
Home page: http://www.pmel.noaa.gov/~kessler





> Date: Wed, 2 Mar 2005 14:33:34 -0500 (EST)
> From: Ming Yang <myang@email.unc.edu>
> To: ferret_users@noaa.gov
> 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
> 
> 


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement