A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

SSH HELP (BASH): I am trying to write a bash script to determine the gross pay of workers, here is what I have so far what am I missing, I can provide further details if needed. Thanks if [ hours_worked -le 40 ] ; then (rate*hours_worked)+ bonus_pay elif [$hours_worked -gt 40 ] && [$hours_worked -le 54] ; then ((rate*40)+((rate*2)*(hours_worked-40)+ bonus_pay)) && (rate*hours_worked)+ bonus_pay else ((rate*40)+((rate*2)*14)+((rate*3)*(hours_worked-54)+ bonus_pay)) fi

  • This Question is Open
  1. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    For this type of problem, you may want to consider starting with the largest comparison first and working your way down to the smallest. Your else if code has a "&&" in it. What are you comparing? "&&" is the logical and operator used like: if [[ $THIS && THAT ]] then In BASH, when you want to use the value of a variable, the variable needs to be referred to as $VARIABLE_NAME. You need the '$'. Variables in BASH are held as strings. All math operations require the double parenthesis.

  2. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    By the way, what does SSH have to do with this?

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.