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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:18:22+00:00 2026-06-03T07:18:22+00:00

I have the above shell script . #!/bin/bash # a shell script that keeps

  • 0

I have the above shell script .

#!/bin/bash

# a shell script that keeps looping until an exit code is given

nice php -q -f ./data.php -- $@
ERR=$?

exec $0 $@

I have a few doubts

  1. What is $0 and what is $@
  2. what is ERR=$?
  3. what does -- $@ in 5th line do
  4. I wanted to know if can i pass data.php as a parameter. so that i have only i shell script for all kind of execution . Say, i want to run “sh ss.sh data1.php” then this should run data1.php, if run “ss ss.sh data2.php” it should run data2.php –
  • 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-03T07:18:24+00:00Added an answer on June 3, 2026 at 7:18 am

    1) $0 is the name of the executable (the script in your case, eg: if your script is called start_me then $0 is start_me)

    2) ERR=$? gets the return code of nice php -q -f ./data.php -- $@

    3) -- $@ does two things, first of all it tell the php command that all following parameter shall be passed to data.php and $@ passes all given parameter to the script to ./data.php (eg. ./your_script_name foo bar will translate to nice php -q -f ./data.php -- foo bar)

    4) short answer yes, but you have to change the script to

     YOUR_FILE=$1
     shift #this removes the first argument from $@
     nice php -q -f ./$YOUR_FILE -- $@
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#!/bin/bash for((i=1;i <=10;i++)) do php /var/www/get.php done I have the above shell script that
I have a C shell script that does something like this: #!/bin/csh gcc example.c
Have been writing the shell script such as : #! /bin/bash `sqlplus -s <username>/<passwd>@dbname`
<p><span class=linky><a href=deletephone.php?id=' . $row['id'] . '>Delete Phone</a></span></p><br /> I have the above code
I have a folder \folder\ above the webroot that contains .php , .inc ,
I have noticed that Solaris 10's Bourne shell, /bin/sh (and also /sbin/sh ) forks
I have a shell script that will let me access global variables inside the
I am trying a simple shell script like the following: #!/bin/bash up_cap=$( cat result.txt
I have a shell script which has a for loop that prints the value
I have bash script that takes in a couple of arguments tests then and

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.