[Thread Prev][Thread Next][Index]

Re: [ferret_users] General question about functionalities and customization




> On Jun 16, 2020, at 5:51 PM, Fiedler, Russell (O&A, Hobart) <Russell.Fiedler@xxxxxxxx> wrote:
> 
> 4) I use journal files in development. Just cut and paste the necessary parts of your interactive sessions into a .jnl file.
> 
> There's an FAQ on rempoving/renaming jounal files
> 
> https://ferret.pmel.noaa.gov/Ferret/faq/controlling-ferret-jnl-files

This may be an opportune time to repost (from Jan 2000!) some homemade add-ons for working with jnl files (tcsh shell syntax):

1. In any directory from which I want to run ferret, I make a subdirectory "fjnl".

2. On starting ferret, I 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 subdirectory, 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.

3. I have defined (out-of-Ferret) aliases for the following:

alias txjnl  'tx fjnl/ferret.jnl.~\!*~'      (tx points to my text editor)
alias wcjnl  'wc fjnl/ferret.jnl.~\!*~'    (how big is this jnl file?)
alias lljnl  'ls -lt fjnl/ferret.jnl.~\!*~'    (when was it created?)
alias grepjnla  'grep \!* fjnl/*'           (search all of the jnl files)
alias grepjnln  '/home/pontus/kessler/ferret/grepjnl.com'    (search a particular jnl file by number)
   (where grepjnl.com is an executable file consisting 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 #233). Now I can see what files I used, what scripts I called, and what variables I defined in that session:

> grepjnln use 233
> grepjnln go 233
> grepjnln let 233

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

> wcjnl 233
> txjnl 233

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

Billy K




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

Privacy Policy | Disclaimer | Accessibility Statement