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/bash | |
for index in `cat -n $1 | grep -vE '#+\s'| grep -E '#+' | awk '{print $1}'`; | |
do | |
echo "第"$index"行"; | |
arg="sed -i '.bak' '${index}s/\#\{1,\}/& /g' $1" | |
echo $arg | sh | |
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/bash | |
# Mac 上 readlink -f 无法使用的替代代码 | |
TARGET_FILE=$0 | |
cd `dirname $TARGET_FILE` | |
TARGET_FILE=`basename $TARGET_FILE` | |
while [ -L "$TARGET_FILE" ] | |
do |
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/bash | |
for name in `cat domian.txt`; | |
do | |
nslookup $name| grep -E 'Add|Nam' |awk -v awk_var="$name" '!/#/{printf awk_var" "$2"\n"}' >> dns.txt | |
done | |
awk '{if(NR%2==0){printf $2 "\n"}else{printf "%s ",$0}}' dns.txt > ipoder.txt | |
#sort -k 3 ipoder.txt -o dns.txt | |
#rm -f ipoder.txt | |
awk '{printf "%-40s|%-60s|%-20s\n", $1, $2, $3;}' dns.txt > order.txt |
NewerOlder