No Such file or directory.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting No Such file or directory.
# 1  
Old 06-21-2011
No Such file or directory.

Hello all,
I am trying to run below script for emailing an attachment. However, I receive the email without attachment.

Error:
Code:
/u04/oracle/devappl/xxwc/11.5.0/bin/excel_tut.pdf
: No such file or directory

My code:
Code:
#!/usr/bin/sh
#
# $5 - Email id
# $6 - Subject

echo "Email Test Started"
attfile=/u04/oracle/devappl/xxwc/11.5.0/bin/excel_tut.pdf
attfname=excel_tut.pdf
MESSAGE="Hi,
Please find attached the requested attachment.
Thanks."
(echo "$MESSAGE";uuencode ${attfile} ${attfname})|mailx -s "$6" $5
exit 0


Last edited by zaxxon; 06-21-2011 at 10:22 AM.. Reason: code tags, code
# 2  
Old 06-21-2011
What happens when you issue:
Code:
ls -la /u04/oracle/devappl/xxwc/11.5.0/bin/excel_tut.pdf

?

Make sure the file exists and you have at least permissions to read it.

Last edited by zaxxon; 06-21-2011 at 10:46 AM.. Reason: added ls -la...
# 3  
Old 06-21-2011
The file exists and has full permissions
Code:
$ pwd
/u04/oracle/devappl/xxwc/11.5.0/bin
$ ls -la excel_tut.pdf
-rwxrwxrwx   1 appldev    dba         563363 Jun 21 10:40 excel_tut.pdf

Moderator's Comments:
Mod Comment Use code tags - checkout (B) in https://www.unix.com/misc.php?do=cfrules, thanks.

Last edited by zaxxon; 06-21-2011 at 10:23 AM.. Reason: code tags
# 4  
Old 06-21-2011
Code:
/u04/oracle/devappl/xxwc/11.5.0/bin/excel_tut.pdf
: No such file or directory

This looks suspicious, like it thinks it has control characters on the end of the line which it's taking to be part of the filename. Did you edit this script in notepad?

Last edited by Corona688; 06-21-2011 at 12:26 PM..
This User Gave Thanks to Corona688 For This Post:
# 5  
Old 06-22-2011
Thanks corona,
The problem was resolved once i used vi instead of pushing it from windows.
But the problem, uuencode is not attachhing the file instead it gives some wierd characters in message body.
Can anybody help in this issue.
# 6  
Old 06-22-2011
Quote:
(echo "$MESSAGE"; (uuencode ${attfile} ${attfname}))|mailx -s -m "$6" $5
just worth a try ...
# 7  
Old 06-23-2011
I have already tried this

Quote:
(uuencode ${attfile} ${attfname})|mailx -s -m "$6" $5
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find and get a file in an entire directory with an excluded directory specified?

How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on: $ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies

2. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

3. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

4. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

5. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

6. Shell Programming and Scripting

Script which removes files from the first directory if there is a file in the second directory

Script must removes files from the first directory if there is a file with same name in the second directory Script passed to the two directories, it lies with them in one directory: sh script_name dir1 dir2 This is my version, but it does not work :wall: set - $2/* for i do set -... (6 Replies)
Discussion started by: SLAMUL
6 Replies

7. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

8. Shell Programming and Scripting

File transfer from one directory to another directory in unix

Hi, I have to transfer five files from one directory to another directory in unix with the help of shell scripts. This shell script calling the param file as input parameter. Every day one file will come and fall on my source directory. Remaining files will fall on any one of the day of the... (5 Replies)
Discussion started by: easterraj
5 Replies

9. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

10. UNIX for Dummies Questions & Answers

Copying one file at a time from one directory to another directory.

Hi All i want to write a script which could copy one file at a time from one directory to another directory. Scenerio: Let's say i have 100 file in a dirctory,so i want to copy one file at a time to another directory with a sleep statement in between that of 30 secs. please help me... (1 Reply)
Discussion started by: Nikhilindurkar
1 Replies
Login or Register to Ask a Question