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 6982661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:19:06+00:00 2026-05-27T18:19:06+00:00

I want to search all the ksh scripts present from root directory and take

  • 0

I want to search all the ksh scripts present from root directory and take out the directory path and check whether that directory is created /exists or not? this is the sample ksh script? Please help on this?

cd /home/edwprod/cormis/bin
if [ -f /home/edwprod/cormis/bin/churn.txt ]
then
echo " data not loaded in the table"
exit 0
else
cd /home/edwprod/edw/cfg
echo "XFB process is about to start"
/home/edwprod/edw/cfg/AUTOMATE_XFB_ADVISOR.ksh
fi
/osmf/mgmt/scheduler/edw/ROMEO/bin >cat EDWADVCHR.ksh
if [ -f /home/edwprod/cormis/bin/churn.txt ]
then
        cd /home/edwprod/cormis/bin/
        rm -f churn.txt
fi
/home/edwprod/cormis/bin/edw_etl_adv_churn_error.ksh CO_POP_ADVSR_DSCN_CHURN_I P
  • 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-05-27T18:19:07+00:00Added an answer on May 27, 2026 at 6:19 pm

    Here is an example script that tests if a list of directories exists or not.
    It will print out the names of the missing directories, and exit with a non-zero return code if one of them is missing.

    #! /bin/sh
    dirs_to_check="/home/edwprod/cormis/bin
                   /home/edwprod/cormis/log
                   /home/edwprod/edw/cfg"
    
    ok=1
    for dir in $dirs_to_check ; do
        if [ ! -d $dir ] ; then
            echo "Directory $dir does not exist"
            ok=0
        fi
    done
    
    if [ $ok -ne 1 ] ; then
        exit 1
    fi
    

    You could fix this script to create the missing directories if you want.

    It’s not really necessary though. You could just adapt what you have and check that cd worked:

    cd /some/path
    if [ $? -ne 0 ] ; then
      # you failed to cd: either the directory doesn't exist, 
      # or you have permission issues
    fi
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to search a directory for all files that match a certain pattern.
I want to search a file in the current directory from which the batch
I want to search in all files from the current folder for macro CODE_INIT_PARAMETERS
I want to search in all fields from all tables of a MySQL database
Mainly I want to search for all lines that contain XXX and YYY on
I'm working on a search feature for my application, I want to search all
I want to search for all elements with class needle in all elements returned
I am using Oracle 10g at the moment. I want to search through all
I want to search a table to find all rows where one particular field
I got this url /search/renttype-all.place-all.type-all.bedrooms-all.0.0/ I want to get the text after the second

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.