The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Changing windows server alias name on windows or unix? NycUnxer UNIX for Dummies Questions & Answers 1 03-26-2008 05:54 PM
SFTP from windows E:/ to unix server pranavagarwal Shell Programming and Scripting 12 11-28-2007 10:58 AM
Shell Script to ftp from windows server shilpa.rajput Shell Programming and Scripting 8 11-07-2007 12:52 AM
Windows Client Vs Unix Server? collins High Level Programming 0 10-05-2004 10:49 PM
Windows Server 2k3 vs. Unix CapsuleCorpJX UNIX for Dummies Questions & Answers 1 08-08-2004 05:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-19-2007
madhunk madhunk is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 91
Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server

I have a .sh script which was running fine on all the UNIX Servers (AIX, SunSolaris). The script requires two mandatory parameters and many optional parameters. Now at a different client place who are on a Windows Server, when I try to execute the script through MKS Toolkit, there are couple of issues. The script runs very well if I don't provide any optional parameters. I don't understand why the script doesn't treat those as optional parameters. Am I invoking the wrong shell? I tried many options...

Sample script:
Code:
#!/bin/ksh
while getopts :s:u:p:f:m:w:r: Option
do
    case $Option in
        s) Server=$OPTARG;;
        u) User=$OPTARG;;
        p) PassWd=$OPTARG;;
        f) ParmFile=$OPTARG;;
        m) Mode=$OPTARG;;
        w) Warn=$OPTARG;;
        r) Rows=$OPTARG;;
        :) echo "ERROR: Invalid argument. $OPTARG requires a value."
           display_usage;;

        ?) echo "ERROR: Unknown option $OPTARG."
           display_usage;;
    esac
done

shift `expr $OPTIND - 1`
This is how it is executed.

Code:
BatchRun.sh -p <optional> <mandatory> <mandatory>
I tried many ways to give quotes around the optional parameters on the command line. But it doesn't recognize the -p on the command line.

Please advice if somebody had the same issue..
  #2 (permalink)  
Old 12-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by madhunk View Post
when I try to execute the script through MKS Toolkit, there are couple of issues.
Have you tried

(a) Cygwin

(b) Microsoft Services for UNIX
  #3 (permalink)  
Old 12-19-2007
madhunk madhunk is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 91
I am using MSK Toolkit and have not yet downloaded Cygwin...

But Microsoft services for UNIX is for integrating Windows into their existing UNIX-based environments..right?

I am able to run the shell scripts...It is just that the MSK Toolkit is not taking the -f or -n or -p optional parameters.
  #4 (permalink)  
Old 12-19-2007
idle idle is offline
Registered User
  
 

Join Date: Oct 2007
Location: Wellington, New Zealand
Posts: 30
I would hazard a guess and say that you need to pose that question on some Windows forums.
  #5 (permalink)  
Old 12-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by madhunk View Post
But Microsoft services for UNIX is for integrating Windows into their existing UNIX-based environments..right?
Not sure what you mean, but it's a relatively complete environment built on top of NT's POSIX subsystem. I use ver 3.5 on both XP and 2K.

Code:
getopt(1)                                                     getopt(1)

  getopt

  NAME

    getopt - parse utility options

  SYNOPSIS

    set -- 'getopt optstring $*'

  DESCRIPTION

    The getopt(1) utility (not to be confused with the getopts(1) command)
    separates options in command lines so they can be parsed and validated by
    shell procedures. The opstring argument is a string of recognized option
    letters. If a letter is followed by a colon, the option is expected to
    have an argument which may or may not be separated from the option by
    blank space. The special option "--" delimits the end of the options. The
    getopt(1) utility places "--" in the arguments at the end of the options,
    or it will recognize "--" if it is explicitly used. The shell arguments
    $1, $2, and so on, are reset so that each option is preceded by a "-" and
    in its own shell argument; each option argument is also in its own shell
    argument.

  DIAGNOSTICS

    The getopt(1) utility prints an error message on standard error if it
    encounters an option letter not specified in the opstring argument.

  SEE ALSO

    getopts(1)

    getopt(3)
  #6 (permalink)  
Old 01-31-2008
sidinsd sidinsd is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 2
Please send me a private message

Hello, Mr. Porter.

I am trying to use Windows SFU version 3.5 to port a UNIX POSIX compliant C program to Windows. You say you use this version, do you use it to compile programs or just for other tasks?

The problem I am running into is that it seems there are a bunch of Windows external references that get thrown in automatically by the cc command that are not in the libraries provided by the SFU system. The specific external reference is __security_cookie and in Windows it is in the mscvrt.lib file, but it doesn't seem to be in any of the .a files provided by the SFU.

Any help you could provide for me on this subject would be greatly appreciated.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0