I have the following in a shl script:
I want to copy the file FILE_NAME to LIST_FILE_PATH
I know I have all the permissions I need.. I am getting the following error:
It is sending the file to >/u01/scott/ (I put this to test)
like ${FILE_NAME} ${LIS_FILE_PATH} ${LIS_FILE_NAME}
it should be szpcal1_saisusr_79847.lis with the data of FILE_NAME
Last edited by Franklin52; 03-24-2011 at 04:10 AM..
Reason: Fixed code tags
After making the corrections to the variable names as suggested above, please re-test and then post the complete script in code tags (including the SQL bit) because there is no way that the error message containing "[[" came from the script posted in post #1.
Also, please stop putting semi-colons at end of Shell command lines. This is unix Shell not SQL.
Most of the typing errors in your script have been addressed. Just to make clear another poster's point:
Should be using double quotes not single quotes. Within single quotes the $ variables are not expanded, within double quotes the $ variables are expanded. Also the variable name ${FILE_NAME} appears to be correct in the "echo" statement but incorrect in the actual "cp" statement.
Quote:
cp ${FILE_NAME} ${LIS_FILE_PATH} ${LIS_FILE_NAME}
In additon to the typing errors in the names of the variables, your "cp" line is missing a solidus.
Also the variable ${LIS_FILE_NAME} should probably be ${FILE_NAME}. Hard to tell for definite without seeing the whole script.
The /CODE tag terminator is missing from your CODE tags in your post.
I have a bash script that is running a mysql query and creating a csv file with a time stamp. It then uploads that to a ftp server. Everything works great when I manually run it. But then I have a cron job set to run every monday, wednesday and friday at 5am est. When the cron job runs, it... (7 Replies)
I need to decrypt a file in a directory, I need to write a shl scrip & cron job
How I find the files in the directory:
the file is like this:
dailypayments_sfs_payment_201011151800.dat -d
The decrypt command:
gpg -o dailypayments_sfs_payment_201011151800.dat -d
20101115 (the date... (7 Replies)
After I move the file to a directory, I need to gzip and encrypted.
I never do this in a shl script, I do it from the command line and it works..
cd /home/nelnet
spinel:/home/nelnet$ gpg -e 2010_11_07_05_11_xxxxxx_bills.dat.gz
`/home/nelnet/.gnupg/gpg.conf'
`/home/nelnet/.gnupg/gpg.conf'... (3 Replies)
I want to capture a last file in a directory in a shl scrip
Cd to the directory
$last ls -1 *the_bills.dat* | tail -1
This is not problem, but I need to copy that file to another directory, but in order to be able to copy to that directory, I need to su in unix, I am sure my sistem... (2 Replies)
When I run this code from the command line works
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ ls ef*
eftseq.dat
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ file_seq=$( < eftseq.dat) ... (1 Reply)
have this shl that will FTP a file from the a directory in windows to UNIX, It get the name of the file stored in this variable $UpLoadFileName then put in the local directory LocalDir="${MPATH}/xxxxx/dat_files" that part seems to be working, but then I need to take that file and rename, I am using... (3 Replies)
I am trying to read a file in a shl script (only one record) and stored in a variable file_number
I got the following
read -u $BANNER_HOME/xxxxxxx/misc/EFTSQL.dat file_number
file_number2 = $file_number + 1
echo $file_number2 > $BANNER_HOME/xxxxxx/misc/EFTSQL.dat
EOF
It is not working... (2 Replies)
Hi guys I want to create a script which will show the amount of data that is been copied from one location to another location.
For example:
Say i have a file called abc.img which is approximately 4 gb of size therfore everytime i copy the file from one location to another i want a progress bar... (3 Replies)
need to be able to capture a file with the following conditions:
The filenames are, for example, 3526_332840.dat, where 3526 is constant, and 332840 is a sequential number which is always a couple hundred greater than the previous day's file.
I want to be able to change this script to acoomplish... (1 Reply)
Hello. Complete newbie over here, and I'm hoping you can help me out with this problem.
The script copies a file to a directory within my home dir.
Permissions are ok and the source file exists. If I execute the cp command from the command line or hardcode the path/file name, it works.
... (6 Replies)