on 07-24-2007 6:50 PM
Hi folks,
I am facing some problem in the Shell script and the command line parameter.
The scenario is -- I am picking a file from a directory, whose path is <b>/interfaces/xid/receive/filename.dat</b>
I have to encrypt filename.dat and move it to another folder, whose path is <b>/interfaces/xid/send</b>. So, the encrypted file will reside in the <b>send</b> directory.
Now, I don't want to hardcode the new path, where the encrypted file has to be moved. Please let me know how to achieve this. Please consider this as urgent.
Have a look at the command line in the "before message processing" -- <b>/interfaces/xid/receive/xi_decompress.sh /interfaces%F</b>
Have a look at the shell script for the same --
#!/bin/sh
#----
Setup environment variables
#----
COMMPRESS_DIR=/interfaces/software/commpress
export COMMPRESS_DIR
LOG_DIR=/interfaces/software/commpress/log/
export LOG_DIR
IN_FILE=$1
export IN_FILE
Find the directory where the unencrypted file is deposited
IN_FILE_DIR=`dirname $1`
export IN_FILE_DIR
Make sure the working directory is where the unencrypt.key is...
cd $COMMPRESS_DIR
encrypt the file
if [ `uname` = "HP-UX" ]
then
find $IN_FILE | $COMMPRESS_DIR/compx $IN_FILE_DIR logpath=$LOG_DIR
else
find $IN_FILE | $COMMPRESS_DIR/compx-sun $IN_FILE_DIR logpath=$LOG_DIR
fi
Get the result of the encryption
RET_CODE=$?
Check decryption result
If error (retuen code <> 0), create an error log file in the
same directory as the input file.
if [ $RET_CODE -ne 0 ]
then
PREFIX="Decryption"
DATE_TIME=$(date +%Y%m%d_%H%M%S%N)
SUFFIX="err"
FILENAME=$/$_$.$ echo "Decryption Error log" >$FILENAME echo "DATE_TIME: $" >>$FILENAME echo "DIRECTORY: $" >>$FILENAME
echo "FILE: $" >>$FILENAME
echo "ERROR CODE: $" >>$FILENAME
fi
exit $RET_CODE
-
What else I need to add in this piece of code? Urgent help !!
Thanks a lot in advance.
Neetesh
Raj,
I think if you pass the directory where to be moved and the filename to be encrypted to the shell script you should be able to resolve your issue. But if you dont pass the directory then I dont think it is possible.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, there is a typo error .. in the script, PREFIX="Decryption" should be replaced by <b>PREFIX="Encryption"</b>
Thanks,
Neetesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.