Skip to content

Instantly share code, notes, and snippets.

@dmuth
Created August 27, 2025 16:55
Show Gist options
  • Select an option

  • Save dmuth/885de08ec677a8e4a136a70142421913 to your computer and use it in GitHub Desktop.

Select an option

Save dmuth/885de08ec677a8e4a136a70142421913 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Dump our files to the screen for copying into the Clipboard and getting into ChatGPT
#
# Errors are fatal
set -e
if test ! "$1"
then
echo "! "
echo "! Syntax: $0 (1 or more filenames or patterns)"
echo "! "
exit
fi
BEENHERE=""
for FILE in $(find "$@" 2>/dev/null || true)
do
if test -f "${FILE}"
then
BEENHERE=1
echo "===== ${FILE} ====="
cat "$FILE"
fi
done
if test ! "${BEENHERE}"
then
echo "!"
echo "! No files were found with these names: $@"
echo "!"
exit 1
fi
echo "====="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment