bash - Is "#\" used to comment next line in tcl? -
in below bash script, "exec expect " invoked replace running bash process, whole script processed again using tcl/expect.
i wondering line 2 "#\" used for.
#!/bin/sh #\ exec expect "$0" "$1" puts "hello!"
it seems used comment next line in tcl? below output of script named 1.
$ ./1 hello!
another question why $1 in script necessary when no parameter fed? if "$1" removed "exec expect" line, output
$ ./1 ": no such file or directory
i think idiom exec expect "$0" "${1+$@}"
fancy way of saying "if there first argument, give arguments. invented old shells. use exec expect "$0" "$@"
, or more simply
#!/usr/bin/env expect
Comments
Post a Comment