[solved] File type error (not a regular file)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [solved] File type error (not a regular file)
# 1  
Old 04-21-2013
[solved] File type error (not a regular file)

Hi friend,

i have written script as below to check the file existance. but i got error

Code:
path="/k/p1100/users/jewel/Output"

FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8`
if  [ -s $path/$FILENAME ] ; then
     echo "$FILENAME is available "
        chmod 755 $path/$FILENAME
        /usr/bin/scp $path/$1 xxx@333:xxx/inbox/
else
        echo "FILE IS NOT AVAILABLE"
fi


error:
/k/p1100/users/jewel/Output: not a regular file

---------- Post updated at 01:17 AM ---------- Previous update was at 01:06 AM ----------

Now i got this, its fine
Code:
path="/k/p1100/users/jewel/Output"FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8`if  [ -s $path/$FILENAME ] ; then     echo "$FILENAME is available "        chmod 755 $path/$FILENAME        /usr/bin/scp $path/$FILENAME xxx@333:xxx/inbox/else        echo "FILE IS NOT AVAILABLE"fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I need help to compare file name with regular expression and do something with file

#!/bin/sh Today=date '+%Y%m%d' for file in `ls *.csv *txt` do echo "Start woprking with ${file}" if ; then do something elif ; then do something else echo "Unkniowned file name" ... (6 Replies)
Discussion started by: digioleg54
6 Replies

2. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

3. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

4. Shell Programming and Scripting

[Solved] SFTP error - Couldn't close file: Failure

I am trying to send a file from my 9000 box to a vendor using sftp and I am getting this error: Couldn't close file: Failure Here are the results of my automated script: Connected to yyy.com. sftp> pwd Remote working directory: / sftp> cd xxxxx/yyyyy_TEST/TEST sftp> put FILE FILETEST... (1 Reply)
Discussion started by: nickg
1 Replies

5. Shell Programming and Scripting

write to multiple files depending on file type (solved)

I want a script that will add comments to a file before check-in files. comments depend on type of files. i have a script to list files in the directory that will be checked-in There are xml, js, html, vm files. vm will use comments like c/c++ ( // or /*..*/) can you help me add a comment line... (0 Replies)
Discussion started by: pradeepmacha
0 Replies

6. HP-UX

[Solved] processor type and bit information

Hi, I'm trying to download a compatible Oracle Client software for a HP-UX machine. I'd like to know if ... 1) HP-UX is 32 bit or 64 bit? 2) Processor type - Itanium or regular? when I execute uname -a I get HP-UX B.11.11 U 9000/800 728684161 unlimited-user license Based on the... (7 Replies)
Discussion started by: luft
7 Replies

7. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

8. UNIX for Advanced & Expert Users

File System Type From File Path?

I'm writing a gui for the core utility shred. I want to be able to warn the user if they are about to shred a file that is on a journaled file system. In order to do this, I must learn the file system type of the path they are about to shred. Is there a way in Unix to: 1. query a specific... (3 Replies)
Discussion started by: codecellar
3 Replies

9. Solaris

Unknown File Type error

Greetings there, i was trying to install an eclipse plugin on sunOS 4.x for the solaris sparc platform, and i got the following error: /usr/project/RAServer/bin> ./RAStart.sh Starting Agent Controller ld.so.1: RAServer: fatal: /usr/project/RAServer/lib/libxerces-c.so.24: unknown file type... (3 Replies)
Discussion started by: rohitsz
3 Replies

10. UNIX for Advanced & Expert Users

file //.ssh/prng_seed is not a regular file

Hi all... On all of my solaris servers (5.5.1,5.6,5.7,5.8 and one 5.9) i get this error message: sshd: fatal: PRNG seedfile //.ssh/prng_seed is not a regular file... Knowing that i have no way to recompile correctly the sources, how can i fix this problem? I'm using openssh, openssl, and... (3 Replies)
Discussion started by: penguin-friend
3 Replies
Login or Register to Ask a Question