Sponsored Content
Top Forums Shell Programming and Scripting Can anybody change this into Linux shell scripts? Post 302780333 by Corona688 on Thursday 14th of March 2013 11:36:01 AM
Old 03-14-2013
A couple things:
Code:
# This is wrong. The space alters the meaning into 'set DATAFILE blank and run the program /OraOutput/interco/'.
DATAFILE= /OraOutput/interco/
DATAFILE1= /OraOutput

# Do this instead:

DATAFILE=/OraOutput/interco
DATAFILE1/OraOutput

# Why are you exporting all these when you could have just used ${1} instead of ${p1} anyway?
 
export p0=$name
export p1=$1
export p2=$2
export p3=$3
export p4=$4
export p5=$5
export p6=$6
export p7=$7
export p8=$8
export p9=$9
# The reason you had to 'shift' here is because
# variables 10 and higher need to be enclosed like ${10} or it will assume you wanted $1.
# It's a good habit to do that for all variables really.
export p10=${10}
export p11=${11}
export "zip_path=$DATAFILE1"
 
# Do NOT put $ for 'read'.  It takes a variable NAME, not a variable VALUE.
read -r -p "Program Name :" p0
# echo "Next param :" p1
read -r -p "Next Param User name :" Username
read -r -p "Next Param Password :" Password
read -r -p "User Id :" p2
read -r -p "User Name :" p3
read -r -p "Request ID :" p4
read -r -p "File Name :" p5
read -r -p "Entity Name :" p6
read -r -p "Email Address :" p7
read -r -p "Extract ID :" p8
read -r -p "path name :" p9
read -r -p "share directory :" p10
read -r -p "Master Request ID :" p11
 
echo "Process and Mail Output files"
echo "$zip_path"

if [ ! -d "$DATAFILE" ] && [ ! -d "$DATAFILE1" ];
then
echo "The Share Directory has not been mapped Contact your System Administrator"
else
cd "$DATAFILE"
echo "changed to datafile"
fi
if [ -e "$DATAFILE/chello_compressed_interco_files.zip" ];
then
# *.* is a DOS thing.
# * doesn't expand outside quotes.
zip -j "chello_compressed_interco_files.zip" $DATAFILE/*
else
echo "after zip"
fi

# -d is for directories.  Use -e to check if a file exists.
if [ ! -e "chello_compressed_interco_files.zip" ];
then 
echo "Process finished goodbye"
else
echo "zip file exists after zip"
# rm "$DATAFILE1"
echo "Before Mail to $p7"
fi

# .exe files are a Windows thing.  If this isn't Windows, you can't run them.
"$DATAFILE/es.exe" $p7 "Chello Interco Extract has completed" "Please find attached the compressed Intercompany spreadsheets" "chello_compressed_interco_files.zip"
echo "After Mail to $p7"
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
RESET(7)						  PostgreSQL 9.2.7 Documentation						  RESET(7)

NAME
RESET - restore the value of a run-time parameter to the default value SYNOPSIS
RESET configuration_parameter RESET ALL DESCRIPTION
RESET restores run-time parameters to their default values. RESET is an alternative spelling for SET configuration_parameter TO DEFAULT Refer to SET(7) for details. The default value is defined as the value that the parameter would have had, if no SET had ever been issued for it in the current session. The actual source of this value might be a compiled-in default, the configuration file, command-line options, or per-database or per-user default settings. This is subtly different from defining it as "the value that the parameter had at session start", because if the value came from the configuration file, it will be reset to whatever is specified by the configuration file now. See Chapter 18, Server Configuration, in the documentation for details. The transactional behavior of RESET is the same as SET: its effects will be undone by transaction rollback. PARAMETERS
configuration_parameter Name of a settable run-time parameter. Available parameters are documented in Chapter 18, Server Configuration, in the documentation and on the SET(7) reference page. ALL Resets all settable run-time parameters to default values. EXAMPLES
Set the timezone configuration variable to its default value: RESET timezone; COMPATIBILITY
RESET is a PostgreSQL extension. SEE ALSO
SET(7), SHOW(7) PostgreSQL 9.2.7 2014-02-17 RESET(7)
All times are GMT -4. The time now is 08:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy