Skip to content

Instantly share code, notes, and snippets.

@sasapurin
Created January 20, 2013 07:43
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 sasapurin/3dfb3f2256957852355c to your computer and use it in GitHub Desktop.
Save sasapurin/3dfb3f2256957852355c to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# 指定URLのHTMLファイルをソースをwgetで取得してsource.txtに保存します。
# このスクリプトの第一引数にURLを指定すると下記$1に代入されてwgetが動作します。
wget -O source.txt $1
#
# trで改行コードを全て削除します。
tr -d '\n' < source.txt > mod1.txt
#
# sedで改行コードをタグの頭に付加します。
sed 's/</\n</g' mod1.txt > mod2.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment