Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:27:52+00:00 2026-06-04T18:27:52+00:00

I have few files in a folder with name pattern in which one of

  • 0

I have few files in a folder with name pattern in which one of the section is variable.

file1.abc.12.xyz
file2.abc.14.xyz
file3.abc.98.xyz

So the third section (numeric) in above three file names changes everyday.

Now, I have a script which does some tasks on the file data. However, before doing the work, I want to check whether the file exists or not and then do the task:

if(file exist) then
     //do this
fi

I wrote the below code using wildcard ‘*’ in numeric section:

export mydir=/myprog/mydata

if[find $mydir/file1.abc.*.xyz]; then 
   # my tasks here

fi

However, it is not working and giving below error:

 [find: not found [No such file or directory]

Using -f instead of find does not work as well:

if[-f $mydir/file1.abc.*.xyz]; then
  # my tasks here

fi

What am I doing wrong here ? I am using korn shell.

Thanks for reading!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:27:54+00:00Added an answer on June 4, 2026 at 6:27 pm

    I was not using spaces before the unix keywords…

    For e.g. “if[-f” should actually be ” if [ -f” with spaces before and after the bracket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few links to .mp4 video files like file1.mp4 file2.mp4 file3.mp4 I need
I have a folder on my remote server that has a few .png files
I have few jar files which I am not getting from any repositories.I have
I have a folder with a few files in it; I like to keep
In almost all of my projects I have few files that are project wide
I have a few files that were part of an update that were mistakenly
I have a few text files and I'd like to count how many times
I have a few log files like these: /var/log/pureftpd.log /var/log/pureftpd.log-20100328 /var/log/pureftpd.log-20100322 Is it possible
I have a Provider and few files in my APK in ANDROID I want
I've got a few files that have been serialized by directly writing C++ struct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.