Sponsored Content
Top Forums Shell Programming and Scripting Can anybody change this into Linux shell scripts? Post 302780255 by monisha on Thursday 14th of March 2013 07:59:37 AM
Old 03-14-2013
Can anybody change this into Linux shell scripts?

Code:
  @echo off
   
  SET "p0=%~0"
  SET "p1=%~1"
  SET "p2=%~2"
  SET "p3=%~3"
  SET "p4=%~4"
  SET "p5=%~5"
  SET "p6=%~6"
  SET "p7=%~7"
  SET "p8=%~8"
  SET "p9=%~9"
  SHIFT
  SET "p10=%~9"
  SHIFT
  SET "p11=%~9"
   
  SET "zip_path=D:\OraOutput\interco\%p10%"
   
  echo Program Name               : %p0%
  rem  echo "Next param                 : %p1%
  echo Next param                 : Username/Password
  echo User Id                    : %p2%
  echo User Name                  : %p3%
  echo Request ID                 : %p4%
  echo File Name                  : %p5%
  echo Entity Name                : %p6%
  echo Email Address              : %p7%
  echo Extract ID                 : %p8%
  echo path name                  : %p9%
  echo share directory            : %p10%
  echo Master Request ID          : %p11%
   
  rm !(D:\temp\XX.txt)
   
  echo Process and Mail Output files
  echo %zip_path%
  IF NOT EXIST D:\OraOutput\interco\%p10%\out\%p11%\ GOTO MAPERROR
  cd D:\OraOutput\interco\%p10%\out\%p11%\
  echo changed to D:\OraOutput\interco\%p10%\out\%p11%\
  IF EXIST D:\OraOutput\interco\%p10%\out\%p11%\chello_compressed_interco_files.zip rm D:\OraOutput\interco\%p10%\out\%p11%\chello_compressed_interco_files.zip
  zip -j D:\OraOutput\interco\%p10%\out\%p11%\chello_compressed_interco_files.zip D:\OraOutput\interco\%p10%\out\%p11%\*.*
  echo after zip
  IF NOT EXIST D:\OraOutput\interco\%p10%\out\%p11%\chello_compressed_interco_files.zip GOTO ENDPROCESS
  echo zip file exists after zip
  REM         rm D:\OraOutput\interco\%p10%\chello_interco*.*
  echo Before Mail to %p7%
  D:\OraOutput\interco\es.exe %p7% "Chello Interco Extract has completed" "Please find attached the compressed Intercompany spreadsheets" D:\OraOutput\interco\%p10%\out\%p11%\chello_compressed_interco_files.zip
  echo After Mail to %p7%
  rm D:\OraOutput\interco\%p10%\out\%p11%\chello_compressed_interco_files.zip
  GOTO ENDPROCESS
  :MAPERROR
  echo The Share Directory has not been mapped Contact your System Administrator
  EXIT -1
  :ENDPROCESS
  echo Process finished goodbye

 

10 More Discussions You Might Find Interesting

1. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

2. Shell Programming and Scripting

find all scripts to change DNS name??

hi, we are going for a new unix box and the ip and DNS name has to be changed in all the scripts, where ever it is hard coded. i was trying the below mentioned command to list all such scripts where the ip/dns name is hard coded: find / -type f -print | xargs grep -l "ip address" >>... (0 Replies)
Discussion started by: Bhups
0 Replies

3. Shell Programming and Scripting

How to make the same change in multiple shell scripts?

I would like to make the same change in multiple shell script files and would like to know if anyone can be of some help? I would appreciate it. (4 Replies)
Discussion started by: rdakhan
4 Replies

4. Shell Programming and Scripting

Scripts fails if you change its code during the execution.

So a script is working properly (tested many times) , then you add a new fine piece of code ,finaly its fails generally with a syntax error at the last line of the script. :confused:... does anybody why this happens? >uname -a HP-UX test... (4 Replies)
Discussion started by: Klashxx
4 Replies

5. Shell Programming and Scripting

how to change default shell in linux?

currently the default shell in my linux enviornemnt is ksh. how to change the default shell to bash? thanks! (8 Replies)
Discussion started by: princelinux
8 Replies

6. Shell Programming and Scripting

shell scripts for linux SLES 10

Hi, could someone help me to create the following scripts Need to create couple of shell scripts on LINUX SLES 10 Using my id --------------- First script – this script should contain su and should take input <process name> 1 -login using my id and then sudo to... (1 Reply)
Discussion started by: lookinginfo
1 Replies

7. Shell Programming and Scripting

Shell scripts migration from HP-Unix 11 to Red Hat Linux

We are changing our OS from HP-Unix 11 to Linux Red Hat. We have few k- shell, c - shell and sql scripts which are currently running under HP-Unix 11. Will these scripts work on LINUX as it is? or we need to do any code changes?IS there anyone who have done this kind of migration before?Thanks for... (2 Replies)
Discussion started by: Phoenix2
2 Replies

8. UNIX for Advanced & Expert Users

What files or programs have the ability to change your default network scripts and config

What files or programs have the ability to change your default network scripts and config files? All 3 of these very important files got changed on their own. /etc/sysconfig/network-scripts/ifcfg-wlan0 /etc/sysconfig/networking/devices/ifcfg-wlan0... (4 Replies)
Discussion started by: cokedude
4 Replies

9. Shell Programming and Scripting

Shell script to change the password on multiple servers in linux

Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies

10. Shell Programming and Scripting

Change indentation in scripts

Hi, I am a professional in writing shell scripts, and I am using a one-space indentation like this for i in file1 file2 do if then echo "$i" fi done so very deeply nested stuff still fits on my screen. At release time I usually double the indentation via sed 's/^ */&&/' to make... (8 Replies)
Discussion started by: MadeInGermany
8 Replies
echo(1B)					     SunOS/BSD Compatibility Package Commands						  echo(1B)

NAME
echo - echo arguments to standard output SYNOPSIS
/usr/ucb/echo [-n] [argument] DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output. echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi- ronment variables. For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows: o echo your current-working-directory's full pathname o pipe the output through tr to translate the path's embedded slash-characters into space-characters o pipe that output through wc -w for a count of the names in your path. example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w" See tr(1) and wc(1) for their functionality. The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's echo() also understands a as the audible bell character; however, these commands do not have an -n option. OPTIONS
-n Do not add the NEWLINE to the output. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5) NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases. SunOS 5.11 3 Aug 1994 echo(1B)
All times are GMT -4. The time now is 10:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy