PaulStoffregen
Well-known member
Ok, I need help on a Windows batch file. Hoping some of the Windows experts here can comment...
The goal is a batch file similar to Frank's suggestion on this thread, but without the command embedded, and with the ability to pass an arbitrary number of extra args.
This is required because Arduino's platform.txt doesn't provide a way to redirect stdout to a file, and the objdump command doesn't have an option to specify an output file (presumably because all shells let you redirect stdout to a file).
Here's the Unix version for Linux and Macintosh:
It takes the first arg as the output filename to store the text, then the 2nd and all other args are the command to run.
This runs as:
stdout_redirect.sh filename command arg1 arg2 arg3 argN
Can anyone who knows Windows well suggest how to do this with a batch file? If so, we can have nice things....
The goal is a batch file similar to Frank's suggestion on this thread, but without the command embedded, and with the ability to pass an arbitrary number of extra args.
This is required because Arduino's platform.txt doesn't provide a way to redirect stdout to a file, and the objdump command doesn't have an option to specify an output file (presumably because all shells let you redirect stdout to a file).
Here's the Unix version for Linux and Macintosh:
Code:
#! /bin/sh
output=$1
shift
$@ > $output
It takes the first arg as the output filename to store the text, then the 2nd and all other args are the command to run.
This runs as:
stdout_redirect.sh filename command arg1 arg2 arg3 argN
Can anyone who knows Windows well suggest how to do this with a batch file? If so, we can have nice things....