#!/bin/bash echo "/* This file is autogenerated by $0 - do not edit */" echo echo "#include " echo while read atom do # 去掉首位空格 atom_clean=$(echo "$atom" | sed 's/^[[:space:]]*//;s/[[:space:]]$//') # 跳过空行 if [[ -n "$atom_clean" ]]; then echo "extern xcb_atom_t ${atom_clean};" fi done < "$1"