[Thread Prev][Thread Next][Index]

Re: [ferret_users] ferret -script with history



Ryo Furue a écrit :
Patrick,

| I am wondering how to launch ferret with a pre-existing script and get
| a prompt AND history ready to use ?
| | If myscript.jnl is the simple script bellow:
| say "We are in 2009"
| exit/prompt
| | Then if I type
| ferret -script myscript.jnl
| I launch ferret and run the script, get the prompt BUT no history | features (use of arrows up/down). | | Any idea on how to get the load of a script at starting ?

Does this meet your needs?

  $ ferret
        NOAA/PMEL TMAP
        FERRET v6.02
        Linux(g77) 2.4.21-32 - 04/30/07
        21-Jan-09 11:57

  yes? go myscript.jnl
  say "We are in 2009"
  We are in 2009
  exit/prompt
yes?
Probably you don't need "exit/prompt" in this case.
Yes you need this line to get the prompt back and be ready to use ferret with the loaded script.
Another idea is that you write a shell script like

  #!/bin/sh
  rc=$HOME/.ferret
  rc_bak=$HOME/.ferret-bak
  mv $rc $rc_bak
  cat $rc_bak "$1" > $rc
  shift
  ferret "$@"
  rm $rc
  mv $rc_bak $rc

call it, say, "ferret-init-with", and use it as

  $ ferret-init-with myscript.jnl . . . .
Seems not so easy to implement if I have heterogeneous platform users (Linux and Windows).

What about this feature for next release...
Patrick



[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement