functions-in-bash

Unlike in most other languages, parenthesis are not allowed in function calls in BASH:

#!/bin/bash

function test() {
    echo "sudo scanimage --warmup-time 2 --format pnm --depth 8 --resolution $resolution -l $l -t $t -y $y -x $x > $1.pnm";
}

test "bar";

Is working, while

test("bar");

does not work.

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 17, 2019