-
-
Save Tiger6688/c0e23e96d2a6f3bf33ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| until [ -z $1 ]; do | |
| unix2dos $1 2>/dev/null | |
| iconv -f UTF-8 -t GBK $1 -o /tmp/unix2doc.tmp 2>/dev/null | |
| if [ $? -eq 0 ]; then | |
| mv /tmp/unix2doc.tmp $1 | |
| echo "linux2win: converting file $1 to WIN format ..." | |
| else | |
| rm -rf /tmp/unix2doc.tmp | |
| echo "linux2win: converting file $1 is not Linux format ..." | |
| fi | |
| shift | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| until [ -z $1 ]; do | |
| dos2unix $1 2>/dev/null | |
| iconv -f GBK -t UTF-8 $1 -o /tmp/win2unix.tmp 2>/dev/null | |
| if [ $? -eq 0 ]; then | |
| mv /tmp/win2unix.tmp $1 | |
| echo "win2linux: converting file $1 to UNIX format ..." | |
| else | |
| rm -rf /tmp/win2unix.tmp | |
| echo "win2linux: converting file $1 is not WIN format ..." | |
| fi | |
| shift | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment