# insert header cat some_file | sed '1i #new first line' # edit file sed -i '1i #new first line' some_file
echo -e "start transaction;\n$(cat xaa.sql)" > xaa.sql
# in osx
$ cat insert-sql.sh sed -e'1i\ insert into my_table (col1, col2) values ' -e'1s/^,/ /' $1첫줄에 insert 문장을 넣고 그 다음줄의 첫번째 쉼표를 블랭크로 replace 한다.