Find the answer to your Linux question:
Results 1 to 2 of 2
Hi i want to assign a float values in bash shell programming. in c i do like that float s=1.5; int w=5; printf("values of s+w="s+w); some thing like that i ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    1

    hi any one solve my problem

    Hi
    i want to assign a float values in bash shell programming.

    in c
    i do like that
    float s=1.5;
    int w=5;
    printf("values of s+w="s+w);
    some thing like that i want to do in bash shell programming

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Code:
    #!/bin/bash
    
    s=1.5
    w=5
    echo "values of s+w=`echo "$s +$w" | bc -l`"

Posting Permissions

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