Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using sftp batch scripts to automate some file transfers.

Is there a syntax for putting comments in the batch files?

For example:

sftp -b mybatchscript.sftp nick@server

Where mybatchscript.sftp contains:

cd mydir
get *.txt
get *.dat

I'd like to have something similar to:

cd mydir
# Fetch all text files
get *.txt
# Fetch all data files
get *.dat



Ok - it turns out that my guess at a commenting format works just fine.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

It might depend on the sftp server, but with mine using # Whatever as a comment works fine just like you wrote. If it doesn't, you could always do that and just process that file with grep:

grep -v '^#' myBactchScriptNotes.sftp > myBatchScript
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.