Skip to content

Instantly share code, notes, and snippets.

@ncaq
Created February 1, 2023 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncaq/0f14e2ed8f334a9df87ce6511d8cff20 to your computer and use it in GitHub Desktop.
Save ncaq/0f14e2ed8f334a9df87ce6511d8cff20 to your computer and use it in GitHub Desktop.
ファイル名とファイルを連結して一つのファイルにするシェルスクリプト
#!/bin/bash
# tail使った方が良い。
# [unix - Concatenate multiple files but include filename as section headers - Stack Overflow](https://stackoverflow.com/questions/5917413/concatenate-multiple-files-but-include-filename-as-section-headers)
for i in $1/*
do
echo $i
cat "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment