05-29-2014
Check for file with a particular extension in a particular directory
Hi,
I have a directory which I am passing in my script as a parameter. Parameter name has been set to $TCH_FILE_DIRECTORY.
I want to know if there's atleast 1 (or more) files in this directory with the extension '.tch'. How can I find this using ksh.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,,
how to check if directory/file exist using c/c++ under unix/linux? I can use access() under Window MFC. Thanks.
Steven (1 Reply)
Discussion started by: steven88
1 Replies
2. Programming
Hi there,
how to check if directory/file exist using c/c++ under linux/unix. Thanks.
Steven (2 Replies)
Discussion started by: steven88
2 Replies
3. Shell Programming and Scripting
Hi ,
I am FTPing the file. Once the file is FTPied I need to check whether that file currently transferred is of .xls and I need to convert the same to a flat file. What command to use to find the extension of the file?.
Thanks
Mahalakshmi.A (6 Replies)
Discussion started by: mahalakshmi
6 Replies
4. Shell Programming and Scripting
Hi,
How do i check whether a file has extension?
I need to code a script that will check whether a file has extension or not. Say a file Rpt200
If the file doesn't have an extenion, I need to rename the file with .txt extension. For example Rpt200 will become Rpt200.txt
Please advice.
... (2 Replies)
Discussion started by: sunday8
2 Replies
5. Shell Programming and Scripting
$ ls
monkey.txt
banana.csv
tree.txt
$ myscript monkey.txt tree.txt
All extensions ARE alike.
$ myscript *txt
All extensions ARE alike.
$ myscript monkey.txt banana.csv
All extensions are NOT alike.
$ myscript *
All extensions are NOT alike.
My brain has given up; what's the simplest... (11 Replies)
Discussion started by: cs03dmj
11 Replies
6. UNIX for Dummies Questions & Answers
unix program to which a directory name will be passed as
parameter. This directory will contain files with various
extensions. This script will create directories with the names of the
extention of the files and then put the files in the
corresponding folder. All files which do not have any... (2 Replies)
Discussion started by: Deekay.p
2 Replies
7. Shell Programming and Scripting
hi i want to know how to do this
if the given is /tmp/ and it is a valid directory then it will echo directory
if the given is /tmp/file.txt and is a valid file then it will echo file..
thanks! (5 Replies)
Discussion started by: h0ujun
5 Replies
8. Shell Programming and Scripting
I want to know how you would go about checking if something is either a file or a directory. mostly for argument validation stuff.
I know -d is to see if its a directory but im guessing -f is for files?? (1 Reply)
Discussion started by: Waffles
1 Replies
9. Shell Programming and Scripting
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have an inquiry on how do I use the find command in Solaris Unix to find some file ends with extension : txt, err in the root directory with modified date of 30days and this find command will also need to exclude b directory and its subdirectory. All the files from the above find criteria... (5 Replies)
Discussion started by: snowfrost88
5 Replies