Prepare for your Next Interview
This is a discussion on How to test whether the files are existed or not within the Unix/Linux forums, part of the Operating Systems category; How to test whether the files are existed or not in particular folder from required list. If any file missed need to send mail with list of files missed and ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
How to test whether the files are existed or not
How to test whether the files are existed or not in particular folder from required list. If any file missed need to send mail with list of files missed and suspend the process some time
Thanks in advance Suresh Question asked by visitor suresh |
| Sponsored Links |
|
|||
|
Re: How to test whether the files are existed or not
Hi Suresh ,
Whenever we will create a file using Cat Coommand,or ed command,or Vi file name............... We check whether it is create successfully or not using the command echo $? if returns 0 then it create successfully if returns non zero value not create ..... Regards Jahid |
|
|||
|
Re: How to test whether the files are existed or not
-s will checks for the presence of the file.
if [ -s $file ]; then #file found else #file not found fi The variable $file should have the file name with location as /user/barbie/sample.txt. |
|
|||
|
Re: How to test whether the files are existed or not
Dear Rpgubba,
Q. As u told echo $? ,If u want to write a filename instead of "?" That means u write like echo $filename It is not an error but it is take as a variable not a take filename. For instance echo $filename hello how ru the o/p is hello how ru |
| The Following User Says Thank You to md.jahidanwar For This Useful Post: | ||
|
|||
|
Re: How to test whether the files are existed or not
I thnk the command goes like this
#echo $filename where filename is the one which u want to search for??? regards Prakash |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If test case required for testing always post test scenario. | jainbrijesh | Test Cases | 12 | 09-09-2008 11:36 PM |
| Uploading Test Cases into Quality Center and Test Director | Rajani | Test Director | 2 | 05-13-2008 05:27 AM |
| Running Test in Test Director Test Lab without QTP | Geek_Guest | QTP | 2 | 12-24-2007 01:57 AM |
| If no rows existed in target then error will come | Geek_Guest | Data Warehousing | 0 | 04-03-2007 11:20 AM |
| How toTake Backup of all files from Test director 7.2 | swamy.an | Test Director | 1 | 03-01-2007 05:55 AM |