Find the answer to your Linux question:
Results 1 to 3 of 3
Code: #!/bin/bash #program to convert degrees cesius into degrees fahrenheit # echo " enter the temperature in degrees celsius " read a tf = $( echo "(( 9 * $a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    16

    what is wrong with this program? (shell script)


    Code:
    #!/bin/bash
    #program to convert degrees cesius into degrees fahrenheit
    #
    echo " enter the temperature in degrees celsius "
    read a
    tf = $( echo "(( 9 * $a ) /5 ) + 32 "  |bc )  
    echo " $a celsius = $tf fahrenheit " 
    #end
    it is saying " line 6: tf: command not found "

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    BASH is not as flexible a scripting language as many others. You cannot have a space between tr and =. BASH will interpret tr as a command.
    tr=$... is correct.

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    16
    Quote Originally Posted by mizzle View Post
    BASH is not as flexible a scripting language as many others. You cannot have a space between tr and =. BASH will interpret tr as a command.
    tr=$... is correct.
    thanks a million

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •