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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -