Repository: geektime-geekbang/geekbanglinux
Branch: master
Commit: 56d980ff45e4
Files: 22
Total size: 2.6 KB
Directory structure:
gitextract_uj7qur02/
├── README.md
├── demo/
│ ├── 1.sh
│ ├── 10.sh
│ ├── 11.sh
│ ├── 12.sh
│ ├── 13.sh
│ ├── 14.sh
│ ├── 15.sh
│ ├── 2.sh
│ ├── 3.sh
│ ├── 4.sh
│ ├── 5.sh
│ ├── 6.sh
│ ├── 7.sh
│ ├── 8.sh
│ ├── 9.sh
│ ├── README
│ ├── arg.awk
│ ├── kpi.txt
│ ├── myfunc.awk
│ └── result.awk
└── ppt/
└── readme
================================================
FILE CONTENTS
================================================
================================================
FILE: README.md
================================================
# Linux 实战技能100讲
课程相关文档
================================================
FILE: demo/1.sh
================================================
#!/bin/bash
# demo
cd /var/
ls
pwd
du -sh
du -sh *
================================================
FILE: demo/10.sh
================================================
#!/bin/bash
# root user1 other
if [ $USER = root ] ; then
echo "root"
elif [ $USER = user1 ] ;then
echo "user1"
else
echo " other user"
fi
================================================
FILE: demo/11.sh
================================================
#!/bin/bash
# demo if then if then fi fi
if [ $UID = 0 ] ; then
echo " please run"
if [ -x /tmp/10.sh ] ; then
/tmp/10.sh
fi
else
echo " switch user root "
fi
================================================
FILE: demo/12.sh
================================================
#!/bin/bash
# case demo
case "$1" in
"start"|"START")
echo $0 start.....
;;
"stop")
echo $0 stop.....
;;
"restart"|"reload")
echo $0 restart....
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
;;
esac
================================================
FILE: demo/13.sh
================================================
#!/bin/bash
# help display help help
#for pos in $*
#do
# if [ "$pos" = "help" ]; then
# echo $pos $pos
# fi
#
#
#done
while [ $# -ge 1 ]
do
if [ "$1" = "help" ]; then
echo $1 $1
fi
shift
done
================================================
FILE: demo/14.sh
================================================
#!/bin/bash
# functions
checkpid() {
local i
for i in $* ; do
[ -d "/proc/$i" ] && return 0
done
return 1
}
================================================
FILE: demo/15.sh
================================================
#!/bin/bash
# signal demo
trap "echo sig 15" 15
trap "echo sig 2" 2
echo $$
while :
do
:
done
================================================
FILE: demo/2.sh
================================================
#!/bin/bash
# demo 2
cd /tmp
pwd
================================================
FILE: demo/3.sh
================================================
#!/bin/bash
cat > /root/a.sh <<EOF
echo "hello bash"
EOF
================================================
FILE: demo/4.sh
================================================
#!/bin/bash
# test echo
echo $demo_var1
================================================
FILE: demo/5.sh
================================================
#!/bin/bash
# demo
echo "hello bash"
du -sh
================================================
FILE: demo/6.sh
================================================
#!/bin/bash
# PID Pname
echo $$
echo $0
================================================
FILE: demo/7.sh
================================================
#!/bin/bash
# $1 $2... $9 ${10}
pos1=$1
pos2=${2-_}
echo $pos1
echo $pos2
================================================
FILE: demo/8.sh
================================================
#!/bin/bash
# exit demo
pwd
exit 127
================================================
FILE: demo/9.sh
================================================
#!/bin/bash
# if else demo
if [ $USER = root ] ;then
echo " user root"
echo $UID
else
echo " other user"
echo $UID
fi
================================================
FILE: demo/README
================================================
shell 和 awk 演示脚本
================================================
FILE: demo/arg.awk
================================================
BEGIN{
for(x=0;x<ARGC;x++)
print ARGV[x]
print ARGC
}
================================================
FILE: demo/kpi.txt
================================================
user1 70 72 74 76 74 72
user2 80 82 84 82 80 78
user3 60 61 62 63 64 65
user4 90 89 88 87 86 85
user5 45 60 63 62 61 50
================================================
FILE: demo/myfunc.awk
================================================
BEGIN{
function max(num1,num2)
{
if(num1>num2)
return num1
else
return num2
}
}
================================================
FILE: demo/result.awk
================================================
{
sum = 0
for( column = 2 ; column <= NF; column++ )
sum += $column
average[$1] = sum / ( NF - 1 )
if( average[$1] >= 80 )
letter = "S"
else if( average[$1] >= 70 )
letter = "A"
else if( average[$1] >= 60 )
letter = "B"
else
letter = "C"
print $1,average[$1],letter
letter_all[letter]++
}
END{
for( user in average )
sum_all += average[user]
avg_all = sum_all / NR
print "average all:",avg_all
for( user in average )
if( average[user] > avg_all )
above++
else
below++
print "above",above
print "below",below
print "S:",letter_all["S"]
print "A:",letter_all["A"]
print "B:",letter_all["B"]
print "C:",letter_all["C"]
}
================================================
FILE: ppt/readme
================================================
gitextract_uj7qur02/
├── README.md
├── demo/
│ ├── 1.sh
│ ├── 10.sh
│ ├── 11.sh
│ ├── 12.sh
│ ├── 13.sh
│ ├── 14.sh
│ ├── 15.sh
│ ├── 2.sh
│ ├── 3.sh
│ ├── 4.sh
│ ├── 5.sh
│ ├── 6.sh
│ ├── 7.sh
│ ├── 8.sh
│ ├── 9.sh
│ ├── README
│ ├── arg.awk
│ ├── kpi.txt
│ ├── myfunc.awk
│ └── result.awk
└── ppt/
└── readme
Condensed preview — 22 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4K chars).
[
{
"path": "README.md",
"chars": 24,
"preview": "# Linux 实战技能100讲\n课程相关文档\n"
},
{
"path": "demo/1.sh",
"chars": 55,
"preview": "#!/bin/bash\n# demo\ncd /var/ \nls \npwd \ndu -sh \ndu -sh *\n"
},
{
"path": "demo/10.sh",
"chars": 157,
"preview": "#!/bin/bash\n# root user1 other\nif [ $USER = root ] ; then\n\techo \"root\"\nelif [ $USER = user1 ] ;then\n echo "
},
{
"path": "demo/11.sh",
"chars": 207,
"preview": "#!/bin/bash\n\n# demo if then if then fi fi \n\nif [ $UID = 0 ] ; then\n\techo \" please run\"\n if [ -x /tmp/10.sh ]"
},
{
"path": "demo/12.sh",
"chars": 285,
"preview": "#!/bin/bash\n\n# case demo\n\ncase \"$1\" in\n \"start\"|\"START\")\n echo $0 start.....\n ;;\n\n \"stop\")\n e"
},
{
"path": "demo/13.sh",
"chars": 240,
"preview": "#!/bin/bash\n\n# help display help help\n\n#for pos in $*\n#do\n#\tif [ \"$pos\" = \"help\" ]; then\n# echo $pos $pos\n"
},
{
"path": "demo/14.sh",
"chars": 135,
"preview": "#!/bin/bash\n\n# functions\n\ncheckpid() {\n\n local i\n\n for i in $* ; do\n [ -d \"/proc/$i\" ] && return 0\n done\n\n "
},
{
"path": "demo/15.sh",
"chars": 101,
"preview": "#!/bin/bash\n\n\n# signal demo\n\ntrap \"echo sig 15\" 15\ntrap \"echo sig 2\" 2\n\necho $$\n\nwhile :\ndo\n :\ndone\n"
},
{
"path": "demo/2.sh",
"chars": 35,
"preview": "#!/bin/bash\n\n# demo 2\ncd /tmp\npwd\n"
},
{
"path": "demo/3.sh",
"chars": 58,
"preview": "#!/bin/bash\n\ncat > /root/a.sh <<EOF\necho \"hello bash\"\nEOF\n"
},
{
"path": "demo/4.sh",
"chars": 42,
"preview": "#!/bin/bash\n\n# test echo\n\necho $demo_var1\n"
},
{
"path": "demo/5.sh",
"chars": 47,
"preview": "#!/bin/bash\n# demo\n\necho \"hello bash\"\ndu -sh \n\n"
},
{
"path": "demo/6.sh",
"chars": 42,
"preview": "#!/bin/bash\n\n# PID Pname\n\necho $$\necho $0\n"
},
{
"path": "demo/7.sh",
"chars": 78,
"preview": "#!/bin/bash\n\n# $1 $2... $9 ${10}\n\npos1=$1\npos2=${2-_}\n\necho $pos1\necho $pos2\n\n"
},
{
"path": "demo/8.sh",
"chars": 40,
"preview": "#!/bin/bash\n\n# exit demo\n\npwd\nexit 127\n"
},
{
"path": "demo/9.sh",
"chars": 134,
"preview": "#!/bin/bash\n\n# if else demo\n\nif [ $USER = root ] ;then\n echo \" user root\"\n echo $UID\nelse\n echo \" other user\"\n "
},
{
"path": "demo/README",
"chars": 19,
"preview": "\nshell 和 awk 演示脚本\n"
},
{
"path": "demo/arg.awk",
"chars": 59,
"preview": "BEGIN{\n\nfor(x=0;x<ARGC;x++)\n print ARGV[x]\nprint ARGC\n}\n"
},
{
"path": "demo/kpi.txt",
"chars": 120,
"preview": "user1 70 72 74 76 74 72\nuser2 80 82 84 82 80 78\nuser3 60 61 62 63 64 65\nuser4 90 89 88 87 86 85\nuser5 45 60 63 62 61 50\n"
},
{
"path": "demo/myfunc.awk",
"chars": 104,
"preview": "BEGIN{\n function max(num1,num2)\n {\n\tif(num1>num2)\n\t return num1\n\telse\n\t return num2\n }\n}\n"
},
{
"path": "demo/result.awk",
"chars": 647,
"preview": "{\nsum = 0\nfor( column = 2 ; column <= NF; column++ )\n\tsum += $column\n\naverage[$1] = sum / ( NF - 1 )\n\n\n\n\nif( average[$1]"
},
{
"path": "ppt/readme",
"chars": 1,
"preview": "\n"
}
]
About this extraction
This page contains the full source code of the geektime-geekbang/geekbanglinux GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 22 files (2.6 KB), approximately 1.5k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.