"Duncan" <[EMAIL PROTECTED]> wrote: > >#!/bin/bash >export PAN_HOME="~/pan-gmane" >exec pan
For improved portability/usability, you may want to consider using /bin/sh instead, especially if you don't desperately need bash-specific features - not every *nix is spelled "Linux", and many of the others won't even have bash installed by default. In that case you want to use '$HOME' rather than '~'. >A bit more explanation: The first line is often referred to as a shebang. >It's a quite common convention telling many common parsers what executable >to use to interpret the script. Another example, were the script written >in python, might be #!/bin/python, another would be #!/bin/perl. Most >parsers including the three just mentioned will see the last line and hand >execution to the appropriate script parser, if it's not them. Thus, >running the above script in python will still cause bash to be called to >run that script, since that's what the shebang says should be used. Well, first and foremost the shebang is a form of "magic number", which is how the *kernel* figures out how (and if) to run an executable file - see e.g. http://www.faqs.org/faqs/unix-faq/faq/part3/section-16.html (but do consider that the original text was probably written before the birth of Linux - Linux the kernel certainly recognizes this particular "magic number", see fs/binfmt_script.c in the kernel sources). It might be that some interpreters recognize it too, but if so probably only after failure when asking the kernel to execute the file, which just won't happen with current *nix kernels if the file really starts with a shebang. >The second line sets and exports the $PAN_HOME environmental variable. If >it's not exported, bash would see and use the var in this script only -- >pan wouldn't see it and that's our object, so we export it. Note that >this does the same thing as the single-line script walt used, only it's >easier to follow since only one thing is done at a time. The But 'export PAN_HOME="~/pan-gmane"' does two things at the same time too!:-) (Setting the variable and exporting it to the environment.) However the important distinction between VAR=value command and export VAR=value command is that in the first case, VAR is only set in the environment of 'command', whereas in the second case, it is set in the environment of the shell itself, which is inherited by 'command' and everything that comes after. (I.e. no difference in the script above, but anyway...) >A somewhat less resource efficient way of making the bash script exit >would be this line: > >pan & > >The "&" tells bash to execute that command in the "background", and once >launched, to continue with the script. Here, that's less efficient, >because it executes pan as a /new/ process, rather than using the old one >which was just exiting anyway. And there is another (probably more) important difference: If you run the script from the commandline, with the "&" method you will be returned to the prompt immediately (with pan running in the background), whereas with the "exec" method, you won't get the prompt back until pan exits (unless you put the "&" after the script name on the commandline yourself, of course). In general this is probably another argument for the "exec" method, since that leaves the choice of foreground vs background execution up to the user. > I seriously dislike pan's current >smooth-scrolling behavior, for instance, as it induces a feeling very >similar to motion sickness (as previously posted). However, some >(presumably those not so affected <g>) would consider an toggle for that a >feature rather than a bug. I hope that option will make it into 1.0, but >I'll understand if it doesn't, and just continue avoiding "space" for >"read more" since the effect is so personally unpleasant. And finally something on-topic:-) - it's already there (thankfully)! At least in 0.106, not sure when it was added. With GUI and all - look under View -> Body Pane, right where it ought to be. --Per Hedeland _______________________________________________ Pan-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/pan-users
