Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server Post 302152337 by porter on Wednesday 19th of December 2007 03:57:14 PM
Old 12-19-2007
Quote:
Originally Posted by madhunk
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)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTPing files from unix server to windows server

Hi, Below is the script which ftps the file from unix server and putting in a different directory(but on unix server) How can i ftp the files from unix server and to place in a secure location on windows server? what changes needs to be done to the below script? How can this be... (1 Reply)
Discussion started by: venkatesht
1 Replies

2. Shell Programming and Scripting

Perl: Sending file from UNIX server to Windows server

I'm trying to write a Perl script where a file from a UNIX server box connects to a Windows server box and copies that file into the Window box. The main problem I have right now is that whenever I try to connect to the Windows box, the connection is refused. The error message that always pops... (2 Replies)
Discussion started by: kooshi
2 Replies

3. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

4. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

5. Shell Programming and Scripting

Sftp some files from windows server to UNIX server

hi i need to transfer some files from windows server to unix server using SFTP. but before transferring the files, i need to check the existence of a particular file in the remote directory (say r_dir1). if the file is present, then SFTP all the files. after SFTPing the files from the remote... (1 Reply)
Discussion started by: vinit raj
1 Replies

6. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

7. Solaris

FTP-ing files from Windows server to UNIX server

I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output. Is it possible to transfer files from Windows server to unix server through any shell script? If so can you please help me with the details. Thanks in... (8 Replies)
Discussion started by: ssk250
8 Replies

8. Shell Programming and Scripting

Copying the files to Windows server from UNIX server

Hi Team, I had a requirement to write a shell script which automatically transfer the files from unix server to windows server. I can able to unix to unix using Scp command. I am not sure how to do unix to windows. I am very new on this concept. Could you please help me or guide in... (4 Replies)
Discussion started by: gvkumar25
4 Replies

9. Shell Programming and Scripting

Script to communicate from UNIX server to windows server

I have two servers linux and windows and i want to compare files which are in unix server that to windows server and find out which are missing that means i have 50 files with 6000 records in each file on linux server and i want to verify weather these 50 files are present in windows server... (5 Replies)
Discussion started by: sagar_1986
5 Replies

10. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies
GETOPT(1)						    BSD General Commands Manual 						 GETOPT(1)

NAME
getopt -- parse command options SYNOPSIS
args=`getopt optstring $*` set -- `getopt optstring $*` DESCRIPTION
getopt is used to break up options in command lines for easy parsing by shell procedures, and to check for legal options. [Optstring] is a string of recognized option letters (see getopt(3)); if a letter is followed by a colon, the option is expected to have an argument which may or may not be separated from it by white space. The special option ``--'' is used to delimit the end of the options. getopt will place ``--'' in the arguments at the end of the options, or recognize it if used explicitly. The shell arguments ($1, $2, ...) 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. getopt should not be used in new scripts; use the shell builtin getopts instead. EXAMPLES
The following code fragment shows how one might process the arguments for a command that can take the options [a] and [b], and the option [c], which requires an argument. args=`getopt abc: $*` if [ $? -ne 0 ]; then echo 'Usage: ...' exit 2 fi set -- $args while [ $# -gt 0 ]; do case "$1" in -a|-b) flag=$1 ;; -c) carg=$2; shift ;; --) shift; break ;; esac shift done This code will accept any of the following as equivalent: cmd -acarg file file cmd -a -c arg file file cmd -carg -a file file cmd -a -carg -- file file IEEE Std 1003.2 (``POSIX.2'') mandates that the sh(1) set command return the value of 0 for the exit status. Therefore, the exit status of the getopt command is lost when getopt and the sh(1) set command are used on the same line. The example given is one way to detect errors found by getopt. DIAGNOSTICS
getopt prints an error message on the standard error output when it encounters an option letter not included in [optstring]. SEE ALSO
sh(1), getopt(3) HISTORY
Written by Henry Spencer, working from a Bell Labs manual page. Behavior believed identical to the Bell version. BUGS
Whatever getopt(3) has. Arguments containing white space or embedded shell metacharacters generally will not survive intact; this looks easy to fix but isn't. The error message for an invalid option is identified as coming from getopt rather than from the shell procedure containing the invocation of getopt; this again is hard to fix. The precise best way to use the set command to set the arguments without disrupting the value(s) of shell options varies from one shell ver- sion to another. BSD
November 28, 2009 BSD
All times are GMT -4. The time now is 07:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy