temporary file to file then move to directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting temporary file to file then move to directory
# 8  
Old 12-01-2011
What you're doing doesn't seem very clear, I'm afraid. Post the code.

EDIT: From your error, lose the /tmp/ on cat - $WEB already contains the full path.

Last edited by CarloM; 12-01-2011 at 12:59 PM..
# 9  
Old 12-01-2011
...and the ENTIRE code, not just the part that errors out.
# 10  
Old 12-01-2011
just cat $WEB doesnt work it still gives the error

Code:
cat: /tmp/WEB.i077x1v6mW: No such file or directory

Code:
2)
echo "Here is the code:"
cat /tmp/$WEB

break;;

cant get it to work, cat $WEB doesnt work either.

Last edited by gangsta; 12-01-2011 at 11:16 PM..
# 11  
Old 12-01-2011
Post your
PHP Code:
complete 
script, not just option 2 which is broken.
# 12  
Old 12-01-2011
there is nothing wrong with the script it something wrong with the temporary file part

Code:
WEB=$(mktemp -t WEB.XXXXXXXXXX)

Code:
cat $WEB

that is all, i cannot cat the $web variable to view its contents. Thats all im having trouble with
# 13  
Old 12-01-2011
So in that case, does this work for you outside of your script? Just type this in the shell like I did and I did not get any error below:

Code:
sherlock ~]$ WEB=$(mktemp -t WEB.XXXXXXXXX)
sherlock ~]$ cat $WEB
sherlock ~]$ echo $WEB
/tmp/WEB.RvGpfFchV

# 14  
Old 12-01-2011
yes that worked

but when i store something in a file and i do cat $WEB, shouldnt it show me the contents of that file?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Move file from one directory and update the list file once moved.

Dears, I have a listfile contains list of files path. i need to read the line of the listfile mv the file to other directory and update the listfile by deleting the lines of the listfile. #!/bin/bash target=/fstest/INVESTIG/Sadiq/TEST_ARCH while read -r line || ]; do mv $line... (19 Replies)
Discussion started by: sadique.manzar
19 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

How I can find the last file created and move it to a directory?

I have this situation /u03/app/banjobs> ls -ltr icg* 82 Jun 12 10:37 iicgorldi_2419186.log 56810484 Jun 17 10:35 icgorldi_2421592.xml 2859 Jun 17 10:35 icgorldi_2421592.lis - 125 Jun 17 10:35 icgorldi_2421592.log 82 Jun 12 10:37 iicgorldi_2419187.log ... (8 Replies)
Discussion started by: Bernardo Jarami
8 Replies

4. Shell Programming and Scripting

Move file in to directory- script

Hi In directory /mnt/upload I have about 100 000 files (*.png) that have been created during the last six months. Now I need to move them to right folders. eg: file created on 2014-10-10 move to directory /mnt/upload/20141010 file created on 2014-11-11 move to directory /mnt/upload/20141111... (6 Replies)
Discussion started by: primo102
6 Replies

5. UNIX for Dummies Questions & Answers

Mailx - temporary mail message file: No such file or directory

How would I go about resolving this error temporary mail message file: No such file or directory Can anybody tell me where the default location is for the temporary mail message file is for mailx? It appears that it doesn't exist. Thanks (1 Reply)
Discussion started by: joen
1 Replies

6. UNIX for Dummies Questions & Answers

How to move file from one directory to other of only particular user?

I written unix script where a pdf file generates. But if the script is used by multiple people at a time it generates same pdf with two different owner names and creating a problem with permission while moving the file. is there a way where i can move the file filtering with the user? (4 Replies)
Discussion started by: lakers646
4 Replies

7. UNIX for Dummies Questions & Answers

move a file content to another directory

my script is: /u/user/orginal/:#! /bin/ksh find . -name "aur_prog*" -exec grep -il "error" > test.out #awk command to destination directory exit test.out file contain: ./aur_prog1.log ./aur_prog2.log ... (5 Replies)
Discussion started by: roughwal
5 Replies

8. 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

9. Shell Programming and Scripting

A script that will move a file to a directory with the same name and then rename that file

Hello all. I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b: I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused: I have all of my music stored in... (7 Replies)
Discussion started by: marcozd
7 Replies

10. 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
Login or Register to Ask a Question