4. Shebang, comments, and Arguments

4.1. Shebang

When the glue command is installed in a directory, a script has a shebang as follows.

1
2
3
4
5
6
7
$ cat shebang.glue
#!/usr/local/bin/glue

/bin/echo 'shebang'
$ chmod +x shebang.glue
$ ./shebang.glue
shebang

The directory for the glue command can be checked by the following command.

1
2
$ which glue
/usr/local/bin/glue

4.2. Comments

The words after # are regarded as comments.

1
2
3
4
5
6
7
$ cat comment.glue
/bin/echo 'aaa'  #This is a comment.
/bin/echo 'a#aa' #The # in the literal is just a normal charcter.

$ glue comment.glue
aaa
a#aa
  • bug
    • Comments in a pipeline or a job are not treated as comments, and yield errors in the current implementation.

4.3. Arguments

The glue command receives arguments from the command line.

1
2
3
4
$ cat args1.glue
/bin/echo argv[1] argv[2]
$ glue ./args1.glue abc def
abc def

At a short of arguments, an error occurs.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
$ glue ./args1.glue a
Execution error at line 1, char 19
        line1: /bin/echo argv[1] argv[2]
                                 ^

        Array index out of range (pos: 2)
        process_level 0
        exit_status 3
        pid 76075
ERROR: 3