Skip to content

Instantly share code, notes, and snippets.

@krasnobaev
Created April 26, 2023 15:46
Show Gist options
  • Save krasnobaev/96e7f9639b0f6b7a93a4da2d9360b2b8 to your computer and use it in GitHub Desktop.
Save krasnobaev/96e7f9639b0f6b7a93a4da2d9360b2b8 to your computer and use it in GitHub Desktop.
generate source code listing
#!/bin/sh
# usage: scriptname file1 file2 ...
# find . -name '*' | sort | xargs ./list.sh {} \; > ../listing.txt
for file in "$@"
do
[ -f "$file" ] || continue
set -- `wc "$file"`
echo "${file}: lines $1 words $2 bytes $3"
cat -b -t "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment