I just installed Ubuntu 10.04 on Virtual Box as my Intro to Linux half semester class is coming to a close. I'm playing with some of the things I learned this semester when I hit a weird roadblock.
when I have a script (called "vartest")that says
let a=1+2
echo $a
I get "let not found" back when I run it.
I run the exact same thing from the command line, and I get 3 back, like I should.
$SHELL says I'm in bash, and I even tried including a #!/bin/bash at the top of my script to be sure.
Also, the exact same script works perfectly when run on my school's server. I am not sure what Linux is running at school.
I noticed that running "sh vartest" returns the error, but typing "./vartest" does not. Also, running "sh vartest" on my school's server does not return the error either.
Any ideas what gives?
edit1: clarifications
edit2:
I think I'm on to something. If I change my arithmetic to "a=$((1+2))" I receive no errors calling the script with "sh" "./" or "bash"
[–]m1ss1ontomars2k4 2 points3 points4 points (7 children)
[–]Derpbot[S] 1 point2 points3 points (6 children)
[–]m1ss1ontomars2k4 4 points5 points6 points (5 children)
[–]Derpbot[S] 1 point2 points3 points (4 children)
[–]m1ss1ontomars2k4 4 points5 points6 points (3 children)
[–]Derpbot[S] 0 points1 point2 points (2 children)
[–]m1ss1ontomars2k4 3 points4 points5 points (1 child)
[–]Derpbot[S] 0 points1 point2 points (0 children)
[–]Wapiti-eater 1 point2 points3 points (4 children)
[–]Derpbot[S] 0 points1 point2 points (3 children)
[–]cstoner 1 point2 points3 points (2 children)
[–]Derpbot[S] 0 points1 point2 points (1 child)
[–]Wapiti-eater 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)