shell
文章平均质量分 86
陆沙
诚以待己,惜物爱人
展开
-
linux实现远程文件夹共享-samba
linux samba原创 2024-03-05 14:39:25 · 1163 阅读 · 0 评论 -
anaconda使用相关问题
anaconda相关问题原创 2024-03-01 09:48:32 · 364 阅读 · 0 评论 -
shell-note-1-基础篇
1. Shell is a program written in C. It provides an interface for users to access to the service of os kernal. Windows Explorer is a typical graphic interface Shell.2. Shell script is a script wri...原创 2017-02-19 21:43:00 · 57 阅读 · 0 评论 -
shell-code-1
#!/bin/bash# online test tool: http://www.shucunwang.com/RunCode/shell/name="pxy"#Attention for variables' names:#1. No space between "name" and "="#2. First letter must be a-z, A-Z#3. No spa...原创 2017-02-19 21:45:00 · 98 阅读 · 0 评论 -
shell-code-2-传参
#在执行shell脚本时,带参数,如./test.sh 1 2 3,则在脚本test.sh内,参数表示为$n的形式,$1为第一个参数,以此类推。echo "第一个参数为:$1";echo "参数个数为:$#";echo "传递的参数作为一个字符串显示:$*";...原创 2017-02-19 22:01:00 · 61 阅读 · 0 评论 -
shell-code-3-echo用法&printf用法
××××××××××××××××××××××××××××××下面是echo×××××××××××××××××××××××××××××××# read 命令从标准输入(即执行时,键盘的输入)中读取一行,并把输入行的每个字段的值指定给 shell 变量# 在test.sh中,name 接收标准输入的变量read nameecho $name# -e 开启转义echo -e "OK! ...原创 2017-02-19 22:11:00 · 143 阅读 · 0 评论 -
shell-code-4-运算符
#1. shell 基本运算符有:算数、关系、布尔、字符串、文件测试运算符#2. 原生bash不支持简单的数学运算,可使用awk和expr(最常用)echo `expr 1 + 2`# 反引号;表达式和运算符之间要有空格,例如 2+2 是不对的a=1b=2# + - * / % = == !=echo `expr $a / $b`# 乘号(*)前边必须加反斜杠(\)才能实现乘法运算ech...原创 2017-02-20 09:58:00 · 86 阅读 · 0 评论 -
shell-code-5-流程控制
××××××××××××××××××××IF-ELSE××××××××××××××××××××××××××××××a=1b=2if [ $a == $b ]then echo a等于belif [ $a -gt $b ]; thenecho a大于belif [ $a -lt $b ]thenecho a小于belseecho errorfi#if-else常和test一起使用。...原创 2017-02-20 12:57:00 · 84 阅读 · 0 评论 -
shell-code-5-函数
# 函数必须在使用前定义# 如果不写return,将以最后一条命令运行结果,作为返回值。 return后跟数值n(0-255)myFistFunc(){ read a read b return $(($a+$b))}# 调用时直接写函数名字,不要加括号myFistFunc# $?获得函数的返回值echo "$?"# 需要传递参数进去的函数,定义时也...原创 2017-02-20 15:47:00 · 60 阅读 · 0 评论 -
shell-code-6-输入输出重定向
解释:1.文件描述符0通常是标准输入(STDIN,终端),1 是标准输出(STDOUT,终端),2 是标准错误输出(STDERR)。2.如果希望 stderr 追加到 file 文件末尾,可以这样写command 2 >> file3.如果希望将 stdout 和 stderr 合并后重定向到 file,可以这样写command > fil...原创 2017-02-20 16:15:00 · 88 阅读 · 0 评论 -
shell-code-exerciese-1
&&&&&&&&&&&&&&&&&&&&&&&&&&&&代码渣渣奋斗中&&&&&&&&&&a...原创 2017-02-21 10:40:00 · 47 阅读 · 0 评论