Solved

My korn shell script does not work using the windows scheduler

Posted on 2004-08-13
12
468 Views
Last Modified: 2013-12-27
I can run my .ksh script manually using uwin login.exe. But when I try to run the script using the windows scheduler it
does not run.
0
Comment
Question by:tmurray22
  • 4
  • 4
  • 2
  • +1
12 Comments
 
LVL 11

Expert Comment

by:griessh
ID: 11795385
Hi tmurray22,

What is the error.
If the scheduler doesn't find the script, specify the whole path to the script. Also make sure it has all the access rights it needs.
If the script itself fails, check if it has the right environment.

======
Werner
0
 

Author Comment

by:tmurray22
ID: 11797001
The scheduler finds the script just fine, the error is "could not run". The access should be oky because I can run the script
fine if I open a Korn Shell sesson and type the file name in. If I associate the .ksh with the login.exe (this is the exe that opens the korn shell) then I get a dos window asking for a password ????

confused?  I am
0
 
LVL 11

Expert Comment

by:griessh
ID: 11799876
Now I am confused, too.
You are running a korn shell script ... on a UNIX system, I assume
You are loging in to that system from a Windows PC. How do you manually login (username/password)?
Could you please show me what you do?
0
 
LVL 20

Expert Comment

by:Gns
ID: 11809184
This isn't unix/linux, and it certainly isn't about X (as far as I can tell:-)...
Are we talking Cygwin here?

-- Glenn
0
 

Author Comment

by:tmurray22
ID: 11810279
No this isn't unix or linux or cygwin it is Uwin on windows. The application has a login .exe that opens a korn shell session in windows(the script was written for korn shell and I don't want to rewrite it).

I then type test.ksh (assuming i am at the proper directory) and this runs a script that deletes some files. In order to schedule
the test.ksh to run I encounter the problem of first opening the korn shell(login.exe) If I schedule the login.exe first the test.ksh
does not know to run in this session. If  I associate test.ksh with login.exe(properties/open with) then I get what looks like a dos window asking for a password. I type in all sorts of possible passwords(network, local ect. ) but is says login inccorrect.

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 20

Expert Comment

by:Gns
ID: 11810820
Oh, sorry... missed the "u" in the initial question:).

This still has nothing to do with the X window system, but...

From your description you don't have the "I'm missing environment settings" I first thought this would be...
It's years since last I even sniffed on U/Win, so ... If I understand you correctly you are trying to run a specific script as a specific user... The traditional UNIX login command is not the right tool for this (it takes no arguments to speak of, and unconditionally login as another (interactive) user). The correct command would be the su command (Substitute User), perhaps with the -c "command to run" option.

-- Glenn
0
 

Author Comment

by:tmurray22
ID: 11825727
Is there any way to add an argument to the scheduler line to run the script (.ksh)
after the login.exe has opened ? This is the line "C:\Program Files\UWIN3.1\usr\bin\login.exe"
0
 
LVL 20

Expert Comment

by:Gns
ID: 11828577
Hm, dgging a bit shows there's no su command. Bummer. And virtually no useadble info on the login.exe command. Double-Bummer.

Found this about cron though: http://www.wipro.com/uwin/KBinfo/at-cron.html
Perhaps something you could use?

-- Glenn
0
 

Author Comment

by:tmurray22
ID: 12549053
The answer to this question was two-fold it was a permissions issue. The at folder has to be changed from system owner to group owner permissions. and the username and password in the Ksh screen need to be submitted on the same line (ETC UCS username password)


tmurray22
0
 
LVL 20

Expert Comment

by:Gns
ID: 12553553
Thanks tmurray22 for that!

-- Glenn
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12577737
PAQed with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now