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

  • Home
  • SEARCH
  • 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 3807016
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:55:29+00:00 2026-05-19T14:55:29+00:00

I have a script A which call a script G . Inside script G

  • 0

I have a script A which call a script G . Inside script G I cannot change any thing (don’t have write access).

Inside Script G :

ExitProcess ()
{

  case $1 in
    "0" ) echo "$0: Finished successfully."
          exit 0
      ;;
*)  echo "$0: Unknown return status ($1)"
      exit $1
      ;;
 esac

}

Due to which I am exiting from Script A , how to stop this ?

Script A:

check_status()
{

UserName="sbrk6"
MachineName="sn26"

Tstatus=`ssh -f -T ${UserName}@${MachineName} ps -ef  | grep -w "Manager 1 PR" | egrep -v "grep|less|vi|more"`
Cstatus=`ssh -f -T ${UserName}@${MachineName} ps -ef | grep -w "gt1" | egrep -v "grep|less|vi|more"`

if [ "$Tstatus" ]
then
        if [ "$Cstatus" ]
        then

                Gstatus=`ps -ef  | grep -w "Gth_Hndl" | egrep -v "grep|less|vi|more"`

                if [ -z "$Gstatus" ]
                then
                        genth_start
                fi
        fi
else

        if [ -z "$Tstatus" ]
        then
                if [ -z "$Cstatus" ]
                then

                        Gstatus=`ps -ef  | grep -w "Ghfdjdjd" | egrep -v "grep|less|vi|more"`
                        if [ "$Gstatus" ]
                        then
                                genth_stop
                        fi
                fi
        fi
fi
}


genth_start()
{
echo START

. GD1_Sh 

}


genth_stop()
{
echo STOP

. G_Sh

##This is the Script G ###

}

while :
do
        check_status
done

Want this while loop to continue until I kill this script

  • 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-19T14:55:29+00:00Added an answer on May 19, 2026 at 2:55 pm

    If you can’t change Script G, then it is probably easiest to arrange to run it as a separate process rather than using the . (dot) command to run it in the current process.

    If Script G can only be used in the dotted mode, then you could write a third script, call it Script Z, which is designed to run Script G and exit, while your Script A continues happily (reporting the error from Z exiting, then doing whatever is appropriate).

    If that is not feasible either, then you could use eval and $(...) carefully, so that when the functions from Script G that contain exit statements actually exit, they are running in a sub-shell and not in your main shell. This is fiddlier to do than running Script G separately, whether wrapped with Script Z or not, so I’d use one of those mechanisms first.

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

Sidebar

Related Questions

No related questions found

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.