Re: How to "test" shell script without running it?



On Jan 29, 8:04 pm, "oracle DBA" <mansur...@xxxxxxxxx> wrote:
Hi bob,

For the K shell what is option we need to choice just for the systax
checking , is ksh -n script ???,is this way u r testing ....

Regards
Gori Akthar

On Jan 26, 6:05 pm, bobmct <bobm...@xxxxxxxxx> wrote:

Dan Mercer wrote:
Use the -n option:

bash -n script

In vim I have a ksh script called compile tied to F4.
It determines the type of script and calls the appropriate
routine (ksh -n for ksh, perl -c for perl).

It has saved me endless agony over the years.

Dan MercerThanks, Dan;

That's what I was looking for! Funny, thought, I still don't see reference
to it int he bash docs...

But, it does what I was looking for.

Thanks again.

bobmct


Very Good for "test" shell script. Below is my output.

moonhk@hex:/mnt/disk2/ux3/shell$ ksh -n xall.ksh
xall.ksh: warning: line 18: `...` obsolete, use $(...)
xall.ksh: warning: line 19: `...` obsolete, use $(...)
xall.ksh: warning: line 20: `...` obsolete, use $(...)
xall.ksh: warning: line 26: `...` obsolete, use $(...)
xall.ksh: warning: line 30: `...` obsolete, use $(...)
xall.ksh: warning: line 32: `...` obsolete, use $(...)
xall.ksh: warning: line 35: `...` obsolete, use $(...)
xall.ksh: warning: line 40: `...` obsolete, use $(...)
xall.ksh: warning: line 40: `...` obsolete, use $(...)
xall.ksh: warning: line 67: `...` obsolete, use $(...)
moonhk@hex:/mnt/disk2/ux3/shell$

xclient=`ps -ef | grep progres | grep /data | wc -l`




.



Relevant Pages

  • msbuild with msbee error
    ... BCCOMStream.cs: error CS0618: Warning as Error: ... rvices.UCOMIStream' is obsolete: 'Use ... SchemaCollection' is obsolete: 'Use System.Xml.Schema.XmlSchemaSet for ... 'Use XmlReader created by XmlReader.Createmethod ...
    (microsoft.public.dotnet.general)
  • msbuild with msbee error
    ... BCCOMStream.cs: error CS0618: Warning as Error: ... rvices.UCOMIStream' is obsolete: 'Use ... SchemaCollection' is obsolete: 'Use System.Xml.Schema.XmlSchemaSet for ... 'Use XmlReader created by XmlReader.Createmethod ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ConfigurationManager in Beta2
    ... Warning 2 'System.Configuration.ConfigurationSettings.AppSettings' is ... obsolete: 'This method is obsolete, ... >> Error 1 The type or namespace name 'ConfigurationManager' does not exist ... >> A reference to System.Configuration.dll is added to the project. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: pcmcia ioctl removal
    ... the PCMCIA ioctl feature *has* been listed as obsolete ... stuff for which *more than ample warning* has already been given. ... to manage obsolete code as well as we currently do by hand. ... Maybe a mechanism to automatically increase the severity of reporting as the removal date approaches would be an idea? ...
    (Linux-Kernel)
  • Re: Questions About Upgrading to dependency based boot
    ... script behind, package dovecot-common removed but not purged, package ... overrides, insserv: warning: script 'K01nxsensor' missing LSB tags ...
    (Debian-User)

Quantcast