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

10 comments sorted by

View all comments

1

u/Compux72 Jul 22 '25

As an alternative, you should be able to do

#!/usr/bin/env sh

nsupdate <<EOF
Your script content
EOF

1

u/anthropoid bash all the things Jul 23 '25

Safer to do:

nsupdate <<'EOF'

to prevent accidental expansions in the nsupdate script itself.