1

I am using SUA-Korn shell on Windows where in I have set an alias in .profile as alias sqlplus='sqlplus.exe'

So when I start SUA-Korn shell and run sqlplus it calls sqlplus.exe and works fine but when I put same command in .ksh file and run it gives error that 'unknown command sqlplus'

Below is .ksh file

#!/bin/ksh
sqlplus main/main@SID9 @script.sql

If I execute above test.ksh in SUA-Korn shell as

. test.ksh 

then it works fine but

test.ksh

gives

unknown command sqlplus.

Thanks In Advance

dsolimano
  • 8,870
  • 3
  • 48
  • 63
anonymous
  • 1,920
  • 2
  • 20
  • 30

1 Answers1

0

Unfortunately, aliases only work in interactive shells. I would suggest using a function or a variable instead. Both of these will translate to your shell script.

In your .profile:

sqlplus="sqlplus.exe"

In your script:

eval $sqlplus main/main@SID9 @script.sql

Give that a shot.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
hsoj48
  • 36
  • 4