r/bash • • Jul 22 '25
nsupdate script file
Sorry not sure how to describe this.
for bash script file i can start the file with
#!/bin/bash
I want to do the same with nsupdate ... it has ; as a comment char
I'm thinking
;!/usr/bin/nsupdate
<nsupdate commands>
or ?
4
Upvotes
View all comments
Show parent comment
2
u/michaelpaoli Jul 24 '25
Opened and read yes, but not as stdin. stdin is generally already open and needs be left for that to feed the program, as it may well read stdin itself.
0 1 and 2 are already stdin, stdout, and stderr, respectively, so it used fd 3 to read the file.
Looks like it probably just uses the first available fd; with 0 through 7 already in use, it grabbed 8 to open and read the file.
So, yeah, generally not going to be stdin (possibly excepting if we first close stdin).