Sponsored Content
Top Forums Shell Programming and Scripting Clarification on Case command Post 302874873 by narayanv on Sunday 17th of November 2013 06:00:08 PM
Old 11-17-2013
Clarification on Case command

Hi,
I'm a newbie to shell programming and have just written a small program to transfer files.
Code:
# job variables
RunMode=$1

export DATETIME=`date +%Y%m%d%H%M%S`
export STARTTIME=`date +%Y%m%d%H%M`
export ShellDir=/rosetlt/scripts/ksh
export LogDir=/rosetlt/scripts/log
export LogFile=${LogDir}/RTMS_MDM_FTRANS_P14_${DATETIME}.log

case "${RunMode}" in
DEV)   export INDir=/ftpland/RPDX/MDM/${RunMode}
       export ARCDir=/ftpland/RPDX/MDM/${RunMode}/archive
       export OUTDir=/apps/MPI/empi/inbound/drop
       export userid=svc-mpi
       export DestHost=10.130.163.116;;
QA)    export INDir=/ftpland/RPDX/MDM/${RunMode}
       export ARCDir=/ftpland/RPDX/MDM/${RunMode}/archive
       export OUTDir=/apps/MPI/empi/inbound/drop
       export userid=svc-mpi
       export DestHost=10.130.163.10;;
UAT)   export INDir=/ftpland/RPDX/MDM/${RunMode}
       export ARCDir=/ftpland/RPDX/MDM/${RunMode}/archive
       export OUTDir=/apps/MPI/empi/inbound/drop
       export userid=svc-mpi
       export DestHost=165.253.123.39;;
PROD)  export INDir=/ftpland/RPDX/MDM/${RunMode}
       export ARCDir=/ftpland/RPDX/MDM/${RunMode}/archive
       export OUTDir=/apps/MPI/empi/inbound/drop
       export userid=svc-mpi
       export DestHost= ;;
 *)    print "Invalid Env Type.  Values can be DEV,QA,UAT or PROD";;
esac

Moderator's Comments:
Mod Comment please use code tags

Please let me know if anything can be changed to make this more effective.

Regards,
Narayan

Last edited by jim mcnamara; 11-17-2013 at 07:42 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"find" command clarification

Hi everyone, I have a very simple question to ask : How can I locate the files created the last "n" days? (the find command has 3 options : -atime, -ctime, -mtime, but none of these returns the newlly created files ... am I wrong?) Thank you. (3 Replies)
Discussion started by: ck-18
3 Replies

2. Shell Programming and Scripting

nawk command clarification

Hi, I am using the following command. nawk '$1==p{$2=sprintf("%09d",$2+1)};1' p=$JOB_NUM q=$LEN $VALUE_TABLE > ./TEMP_TABLE As you can see the code above, I basically read a value from the table VALUE_TABLE and select a particular row based on searching the value JOB_NUM. Now Actually the... (2 Replies)
Discussion started by: Tux_Raju
2 Replies

3. Solaris

Sun Unix command clarification

I am reading a Sunsolve document covering moving /var and am confused by one step. What does this command do (in English): Move into the existing /var directory and transfer all the data to /newvar # cd /var # tar cvf - . | (cd /newvar; tar xfBp -) (4 Replies)
Discussion started by: FredSmith
4 Replies

4. Shell Programming and Scripting

Need help in Case Command

Hi All I am trying to replace some character using Sed , but i also need to use case commands like this : x=`who am i` opt=`echo ${x} | cut -f1 -d' '` case $opt in unix) 'UNX' My script asks the user to enter the source server and it gets the results it has to reaplace the above... (5 Replies)
Discussion started by: raghav1982
5 Replies

5. Shell Programming and Scripting

need clarification about tr -d command ?

Hi , I need your help to know the exact operation of this following code .. cat file1 | ux2dos | tr -d ''>>file2 file1 contains only one line : "DTS-PO\SPECTRUM WO 56" the data contains a META CHAR "\" .. look at the above line. But , The file2 output contains :... (7 Replies)
Discussion started by: vparunkumar
7 Replies

6. Shell Programming and Scripting

clarification Required in Write command

Hi All, can you please help me to get clarified about the 'write' command. I have a script that sends a content of a file msg.txt to other user 'User B' using 'write' command. Script: ------ ..... cat msg.txt | write "user B" ..... Issue: I face a issue here, this scripts sends... (3 Replies)
Discussion started by: little_wonder
3 Replies

7. UNIX for Dummies Questions & Answers

Clarification on '1 days ago' in date command [Found answer, posted within]

I know the topic of getting yesterday's date has been covered ad nauseum, but I just want to be clear on something. I recently started using the command date --date='1 days ago' '+%m/%d/%y' to get yesterday's date and it's been working great. I just want to be certain that it is going to... (1 Reply)
Discussion started by: DeCoTwc
1 Replies

8. HP-UX

su command clarification

Hi, I want to use the "SU" command in script it is asking me to enter the password manually. pleas the say the syntax of su command in single line that includes username/password. :) (3 Replies)
Discussion started by: vigneshwaran007
3 Replies

9. Shell Programming and Scripting

Net rpc command clarification

Hi, I am checking below command to see the status of windows service from unix but due to "!" sign it is not accepting password. Please suggest alternative what should i do resolve the issue. net rpc service status W32Time -I 10.1.1.1 -U "mydomain\admin%Passwod12!" One more thing... (1 Reply)
Discussion started by: learnbash
1 Replies

10. Shell Programming and Scripting

Please help me in using case sensitive command

Hello All, Please help me with this I need to create a cronjob that should delete all files which are older than 30days with '*.txt' and should not delete files with '*TEST*.txt' either file name TEST is upper or test lower case sensitive here's the script /DIR -type f -name '*.txt'... (7 Replies)
Discussion started by: krish_007
7 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. Please notice this option isn't related to the terminal length as in a "80 culums terminal". --font=desc Set the font description. Default is Monospace 12. --rtl Do right to left (RTL) layout. --paper ps Choose paper size. Known paper sizes are legal, letter and A4. Default is A4. Postscript points Each postscript point equals to 1/72 of an inch. 36 points are 1/2 of an inch. --bottom-margin=bm Set bottom margin. Default is 36 postscript points. --top-margin=tm Set top margin. Default is 36 postscript points. --left-margin=lm Set left margin. Default is 36 postscript points. --right-margin=rm Set right margin. Default is 36 postscript points. --gutter-width=gw Set gutter width. Default is 40 postscript points. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 10:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy