Re: shell command wrapper



adi_guy wrote:
On Nov 20, 1:10 pm, Bill Marcum <marcumb...@xxxxxxxxxxxxx> wrote:
On 2007-11-20, adi_guy <adil.m...@xxxxxxxxx> wrote:

Hi,
I have a properietary linux running on my server. System is
capable of running under low memory conditions.
I have a vi editor available on the system.
A proprietary linux? Is that possible?

I want to create a shell script wrapper over the actual vi command. I
am planning to verify available memory
before launching vi editor. So when somebody types vi command on the
shell prompt, it should invoke my wrapper
then my wrapper would invoke the actual vi editor after verification.
Name your script vi, rename the real vi or change PATH so your vi is
found first; do whatever tests you need and then
exec the_real_vi "$@"

It is not actually proprietary. It is open source distribution with
some extensions...

Thanks for your description. But is it all I have to do ?
Yep.
You could do one thing different - define alias vi (system wide) that would call your script and then follow Bill's suggestion.
And, don't forget to use exec from your script.
.



Relevant Pages

  • Re: linux command wrapper
    ... I have a properietary linux running on my server. ... capable of running under low memory conditions. ... I have a vi editor available on the system. ... I want to create a shell script wrapper over the actual vi command. ...
    (comp.os.linux.misc)
  • shell command wrapper
    ... I have a properietary linux running on my server. ... capable of running under low memory conditions. ... I have a vi editor available on the system. ... I want to create a shell script wrapper over the actual vi command. ...
    (comp.os.linux.development.system)
  • Re: shell command wrapper
    ... I have a properietary linux running on my server. ... capable of running under low memory conditions. ... I have a vi editor available on the system. ... then my wrapper would invoke the actual vi editor after verification. ...
    (comp.os.linux.development.system)
  • linux command wrapper
    ... I have a properietary linux running on my server. ... capable of running under low memory conditions. ... I have a vi editor available on the system. ... I want to create a shell script wrapper over the actual vi command. ...
    (comp.os.linux.misc)
  • Re: Trailing blanks in batch file
    ... Same applies to parentheses and quotes, ... problem as there *being* a trailing space whose presence creates a problem. ... If someone exclusively used an editor that displayed blanks as grey dots, ... can never be sure that one's script will never be edited by someone else ...
    (microsoft.public.win2000.cmdprompt.admin)