![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Linux Support Linux - Operating Systems and Applications Support |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Apr 2006
Posts: 24
OS: WinXp
|
Urgent!
I am having an issue with testing if a file exists in Linux (syntax issue). We are switching from UNIX to Linux at work, so I am going through programs, debugging them and making sure they work on Linux. I am having the following problem: I run a .prog file that, in turn, runs a PL/SQL program that creates one or more output files that all begin with the same 7 characters, and have similar to the following format: 411n9n_xxx_xxx_timestamp Once back in the .prog file, my code is as follows: (I have already changed single brackets to double bracket because of syntax error) Code:
if [[ -f ${EXPORTDIR}/411n9n* ]]
then
xxx
fi
Thank you! |
|
|
|
| Sponsored Links |
|
|
#2 (permalink) |
|
Registered User
Join Date: Apr 2006
Posts: 24
OS: WinXp
|
Re: HELP! Checking IF file exists in Linux - Syntax issue
Arrgggh!!! It works now!
The whole problem was the double brackets. However, when it was just single brackets when I first started testing, it gave me an error about "too many" or "not enough arguments" but the error went away when I made it double brackets instead of just one. So the whole time there was nothing wrong with my original code! What a waste of time. Haha! |
|
|
|
![]() |
| Thread Tools | |
|
|