Sponsored Content
Full Discussion: Korn Shell Wrapper script
Top Forums Shell Programming and Scripting Korn Shell Wrapper script Post 302270675 by methyl on Monday 22nd of December 2008 01:38:35 PM
Old 12-22-2008
1) Count how many different parameters you have. It's not clear from your post.
2) Pass them as $1 $2 $3 $4 ... from the wrapper script.

Code:
e.g. Call 
wrapper_script server_name dest_dir source_dir dest_server user_id list1 ....

e.g. Part of wrapper_script

#!/bin/ksh
server_name="$1"
dest_dir="$2"
source_dir="$3"
dest_server="$4"
user_id="$5"
list1="$6"


script1 "${server_name}" "${dest_dir}" "${source_dir}" "${dest_server}"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple su - in Korn Shell script

i am trying to do something like this : #!/bin/ksh # Change to the userid user1 su - user1 #Issue the command to change directory and list files cd /home/user1/ ls -lrt exit #Come out of the user1 to root again #change to user 2 su - user2 cd /home/user2/ ls -lrt... (2 Replies)
Discussion started by: furrari
2 Replies

2. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies

3. UNIX Desktop Questions & Answers

korn shell script

hi all i am writing the korn shell script. i have a SQL script which gives me the folowing output DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400 DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400 DSA.WLG.20050711210100.20051025.20050711210100 25881 ... (3 Replies)
Discussion started by: pavan_test
3 Replies

4. AIX

Help with Korn Shell script

I have this Korn shell script that runs via a cron entry. It runs in a loop "watching" a specific file system for files with a certain name. The file system that it is watching is an upload file system for an FTP server. When files that are the correct name come in, it takes the extension of the... (1 Reply)
Discussion started by: heprox
1 Replies

5. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

6. Homework & Coursework Questions

Korn Shell Script

1. The problem statement, all variables and given/known data: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. 2. Relevant commands, code,... (3 Replies)
Discussion started by: burm
3 Replies

7. Shell Programming and Scripting

Korn shell script comparison

I have a scenario to implement in Korn shell script. Here it is.. I need to compare two values to see whether they are same or not. The issue is that the values coming in for comparison can be a string or an integer which can be determined during run time only. Which korn shell comparison... (1 Reply)
Discussion started by: vani123
1 Replies

8. Shell Programming and Scripting

Wrapper Script in Perl Or shell

Hello, My requirement is based on Oracle where we run a perl script and it asked some questions.I want to write a wrapper which will answer all these questions. How is it possible. Thanks (16 Replies)
Discussion started by: cotton
16 Replies

9. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

10. Shell Programming and Scripting

Shell Script and Progress Bar or GUI Wrapper

Hi, I have shell script that I am running under Ubuntu as root. Is it possible to hide the command window and show the user some sort of progress /random progress bar / or other form of GUI interaction? On MAC, I have been using Platypus but on Ubuntu I am not sure what to do. (4 Replies)
Discussion started by: naveedanwar4u
4 Replies
rcp(1)							      General Commands Manual							    rcp(1)

NAME
rcp - remote file copy SYNOPSIS
Copy Single File size] size] source_file1 dest_file Copy Multiple Files size] size] source_file1 [source_file2]... dest_dir Copy One or More Directory Subtrees size] size] source_dir1 [source_dir2]... dest_dir Copy Files and Directory Subtrees size] size] file_or_dir1 [file_or_dir2]... dest_dir In Kerberos V5 Network Authentication Environments Copy Single File realm] size] size] source_file1 dest_file Copy Multiple Files realm] size] size] source_file1 [source_file2]... dest_dir Copy One or More Directory Subtrees realm] size] size] source_dir1 [source_dir2]... dest_dir Copy Files and Directory Subtrees realm] size] size] file_or_dir1 [file_or_dir2]... dest_dir DESCRIPTION
The command copies files, directory subtrees, or a combination of files and directory subtrees from one or more systems to another. In many respects, it is similar to the command (see cp(1)). To use you must have read access to files being copied, and read and search (execute) permission on all directories in the directory path. Note that there are special requirements for third-party transfers, which are described in the section below. In a Kerberos V5 Network Authentication environment, uses the Kerberos V5 protocol while initiating the connection to a remote host. The authorization mechanism is dependent on the command line options used to invoke on the remote host (i.e., Kerberos authentication and authorization rules are described in the Secure Internet Services man page, sis(5). Although Kerberos authentication and authorizations may apply, the Kerberos mechanism is not applied when copying files. The files are still transferred in clear text over the network. The option can be set in the file within Refer to the krb5.conf(4) manpage for more information on the If is set to true and the kerberos authentication fails, will use the non-secure mode of authentication. Note: Command line options override the configuration file options. Options and Arguments recognizes the following options and arguments: source_file, source_dir This option specifies the name of an existing file or directory on a local or remote machine that you want to be copied to a specified destination. The source file and directory names are constructed as follows: or Component parts of file and directory names are described below. If multiple existing files and/or directory sub- trees (source_file1, source_file2, ..., etc.) are specified, then the destination must be a directory. Shell file name expansion is allowed on both local and remote systems. Multiple files and directory subtrees can be copied from one or more systems to a single destination directory by using a single command. dest_file This option specifies the name of the destination file. If host name and path name are not specified, then the existing file is copied into a file named dest_file in the current directory on the local system. If dest_file already exists and is writable, then the existing file is overwritten. The destination file names are constructed in the same way as source files except that the usage of file name expansion characters is forbidden in the case of des- tination file names. dest_dir This option specifies the name of the destination directory. If host name and path names are not specified, then the existing file is copied into a directory named dest_dir in the current directory on the local system. If dest_dir already exists in the specified directory path (or current directory if not specified), then a new directory named dest_dir is created underneath the existing directory named dest_dir. The destination directory names are con- structed the in same way as source directory tree names except that the usage of file name expansion characters is forbidden in the case of destination directory names. If the source_dir has more than one file to be copied, the dest_dir does not exist, and if the option is used for recursive copying, then first creates the dest_dir and later copies the files under the source_dir to the dest_dir. file_or_dir If a combination of files and directories are specified for copying (either explicitly or by file name expansion), then only files are copied unless the option is specified. If the option is present, then all the files and direc- tory subtrees whose names match the specified file_or_dir name are copied. This option is applicable only in a secure environment based on Kerberos V5. It can be used to obtain tickets from the remote host in the specified realm instead of the remote host's default realm as specified in the configuration file This option is applicable only in a secure environment based on Kerberos V5. It disables Kerberos authentication. If the remote host has been configured to prevent non-secure access, using this option would result in the generic error, See in remshd(1M) for more details. This option can be used to preserve (duplicate) modification times and modes (permissions) of source files, ignoring the current setting of the file creation mode mask. If this option is specified, preserves the sticky bit only if the target user is superuser. If the option is not specified, preserves the mode and owner of dest_file if it already exists; otherwise uses the mode of the source file modified by the on the destination host. Modification and access times of the destination file are set to the time when the copy was made. This option sets the size of the socket send buffer. This option sets the size of the socket receive buffer. This option can be used to recursively copy directory subtrees rooted at the source directory name. If any directory subtrees are to be copied, recursively copies each subtree rooted at the specified source directory name to directory dest_dir. If source_dir is being copied to an existing directory of the same name, creates a new directory source_dir within dest_dir and copies the subtree rooted at source_dir to If dest_dir does not exist, first creates it and copies the subtree rooted at source_dir to dest_dir and the output will be similar irrespective of whether a wildcard character (source_dir/*) is used for copying or otherwise. Constructing File and Directory Names As indicated above, file and directory names contain one, two, or four component parts: user_name Login name to be used for accessing directories and files on remote system. hostname Hostname of remote system where directories and files are located. pathname Absolute directory path name or directory path name relative to the login directory of user user_name. filename Actual name of source or destination file. File name expansion is allowed on source file names. dirname Actual name of source or destination directory subtree. File name expansion is allowed on source directory names. Each file or directory argument is either a remote file name of the form or a local file name (with a slash before any colon hostname can be either an official host name or an alias (see hosts(4)). If hostname is of the form ruser is used on the remote host instead of the current user name. An unspecified path (that is, refers to the remote user's login directory. If path does not begin with it is inter- preted relative to the remote user's login directory on hostname. Shell metacharacters in remote paths can be quoted with backslash single quotes or double quotes (), so that they will be interpreted remotely. does not prompt for passwords. In a non-secure or traditional environment, user authorization is checked by determining if the current local user name or any user name specified via ruser exists on rhost. In a Kerberos V5 Network Authentication or secure environment, the authorization method is dependent upon the command line options for (see remshd(1M) for details). In either case, remote command execution via remsh(1) and rcmd(3N), or rcmd_af(3N) in case of IPv6 systems, must be allowed and remshd(1M) must be executable on the remote host. Third-Party Transfers Third-party transfers in the following form: are performed as: Therefore, for a such a transfer to succeed, ruser2 on rhost2 must allow access by ruser1 from rhost1 (see hosts.equiv(4)). rcp With IPv6 Address To invoke with an IPv6 address, the IPv6 address must be enclosed in a pair of square brackets as shown in the example below. If the IPv6 address is not enclosed within square brackets, the first occurrence of a colon is treated as the separator between the host- name and the path. WARNINGS
The routine is confused by any output generated by commands in a file on the remote host (see csh(1)). Copying a file onto itself, for example: may produce inconsistent results. The current HP-UX version of simply copies the file over itself. However, some implementations of including some earlier HP-UX implementations, corrupt the file. In addition, the same file may be referred to in multiple ways, for exam- ple, via hard links, symbolic links, or NFS. It is not guaranteed that will correctly copy a file over itself in all cases. Implementations of based on the 4.2BSD version (including the implementations of prior to HP-UX 7.0) require that remote users be specified as rhost.ruser. If the first remote host specified in a third party transfer (rhost1 in the example below) uses this older syntax, the command must have the form: since the target is interpreted by rhost1. A common problem is encountered when two remote files are to be copied to a remote target that specifies a remote user. If the two remote source systems, rhost1 and rhost2, each expect a different form for the remote target, the com- mand: will certainly fail on one of the source systems. Perform such a transfer using two separate commands. With the existing implementation of the remote copy may result in a system overwrite as described in the following example. In this example, if you run as root, and unintentionally type a space between the colon and the slash then assumes both path and (the remote machine's root directory) as source. always interprets the last argument as the destination. Therefore, the destination directory is the local machine's root directory copies the content of path to the root directory first. It then does another copy with as source to the root directory again. This second copy overwrites the local system's root directory with the remote system's root directory DIAGNOSTICS
Diagnostics can occur from both the local and remote hosts. Those diagnostics that occur on the local host before the connection is com- pletely established are written to standard error. Once the connection is established, any error messages from the remote host are written to standard output, like any other data. There are two authentication mechanisms used by One authentication mechanism is based on Kerberos and the other is not. The type of authentication mechanism is obtained from a system file which is updated by inetsvcs_sec(1M). If the system file does not contain known authentication types, the above error is displayed. AUTHOR
was developed by the University of California, Berkeley. SEE ALSO
cp(1), ftp(1), remsh(1), remshd(1M), inetsvcs_sec(1M), rcmd(3N), rcmd_af(3N), hosts(4), hosts.equiv(4), krb5.conf(4), sis(5). rcp(1)
All times are GMT -4. The time now is 07:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy