Welcome, Guest
Username Password: Remember me

Make sure script is running using korn shell
(1 viewing) (1) Guest
Shell Script
  • Page:
  • 1

TOPIC: Make sure script is running using korn shell

Make sure script is running using korn shell 1 year, 5 months ago #434

  • scmuser
  • OFFLINE
  • Gold Boarder
  • scm master
  • Posts: 237
  • Points: 3429
  • Karma: 0
  • Honor Medal 2009
If you have developed a script using the Korn shell, how will you make sure the script will use that shell even if login shell is different?

Re: Make sure script is running using korn shell 1 year, 5 months ago #444

  • renjith
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Points: 15
  • Karma: 0
begin shell script with Shabang/interpreter line

#!/bin/ksh

Re: Make sure script is running using korn shell 1 year, 5 months ago #445

  • rajeshkumar
  • OFFLINE
  • Moderator
  • I love software configuration management
  • Posts: 370
  • Points: 44590
  • Karma: 4
  • Honor Medal 2009
There are 2 ways to run a script with specific shell no matter if login shell is different..

Method 1:
Use following before any shell script...

#!/bin/ksh


Method 2:

Execute shell script with ksh <script-name>
Regards,
Rajesh Kumar
Build and Release Engineer
My Blog: community.scmgalaxy.com/pg/profile/rajeshkumar
  • Page:
  • 1
Time to create page: 0.74 seconds

     
    
Home Forum