
shell
王树民
大JAVA
展开
-
shell 权限脚本
drwxr-xr-x 2 wangshumin wangshumin 4096 1月 30 08:21 音乐/drwxr-xr-x 2 wangshumin wangshumin 4096 1月 30 08:21 桌面/wangshumin@machine2:~$ sh wenjian-e hello wangshumin ...wangshumin@machine2...原创 2018-03-09 16:06:13 · 926 阅读 · 0 评论 -
Shell脚本的简单排错法及调试程序bashdb
Shell脚本的简单排错法及调试程序bashdbhttps://zh.osdn.net/projects/sfnet_bashdb/releases/https://zh.osdn.net/projects/sfnet_bashdb/downloads/bashdb/4.1-0.4/bashdb-4.1-0.4.tar.gz/Jboss 的研究稍有卡壳,那就来点基础教程好了。与众多脚本语言一样,S...转载 2018-04-27 11:41:15 · 865 阅读 · 0 评论 -
shell 编程(四)
五 流程控制 2 for语句 1) 使用in关键字循环 根据变量的不同取值,重复执行一组命令操作 格式: for 变量名 in 取值列表 do 命令序列 done 例子11:循环#!/bin/bash for time in morning noon afternoon evening do echo $time ...转载 2018-03-10 17:25:39 · 199 阅读 · 0 评论 -
批量添加用户
[wangshumin@CentOSNode3 shell]$ cat shelltest8#!/bin/bashi=1while [ $i -le 5 ]do useradd stu$i echo "123456" | passwd --stdin stu$i &> /dev/null #i=`expr $i + 1` i=$(($i+))d...原创 2018-03-10 17:11:40 · 1480 阅读 · 2 评论 -
编程shell
[wangshumin@CentOSNode3 shell]$ [wangshumin@CentOSNode3 shell]$ sh shelltest6请输入:ddd[wangshumin@CentOSNode3 shell]$ sh shelltest6请输入:请输入!!!![wangshumin@CentOSNode3 shell]$ [wangshumin@CentOSNode3 shel...原创 2018-03-10 16:59:38 · 156 阅读 · 0 评论 -
df -h
[wangshumin@CentOSNode3 shell]$ df -h /文件系统 容量 已用 可用 已用% 挂载点/dev/sda3 17G 6.1G 11G 36% /[wangshumin@CentOSNode3 shell]$ df -h 文件系统 容量 已用 可用 已用% 挂载点/dev/sda3 17G 6...原创 2018-03-10 16:25:38 · 2377 阅读 · 0 评论 -
shell编程(三)
沈超shenchao@lampbrother.netweibo.com/lampsc shell编程(三) 四 条件测试 test 测试条件 测试内容 [ 测试条件 测试内容 ] 1 测试文件类型 test -e 文件名 测试文件是否存在,存在为真 [ -e 文件名 ] 注意:[]中必须有空格 test -f 文件名 判断是否是普通文件 t...转载 2018-03-10 16:23:22 · 201 阅读 · 0 评论 -
shell编程(二)
shell编程(二) 二 变量 5 位置参数变量 $0 命令自己 $1 第一个参数 $2 第二参数 $9 第九个参数例2:输出位置参数变量,脚本后要接参数#!/bin/bash echo "the command is $0"echo "canshu1 is $1"echo "canshu2 is $2" 6 预定义变量 $? 上一个命令的返回值...转载 2018-03-10 06:38:59 · 163 阅读 · 0 评论 -
grep
wangshumin@CentOSNode3 shell]$ vim shelltest4[wangshumin@CentOSNode3 shell]$ ./shelltest4input1:1input2:1sum is 2[wangshumin@CentOSNode3 shell]$ vim shelltest4[wangshumin@CentOSNode3 shell]$ ./shel...原创 2018-03-10 06:20:23 · 185 阅读 · 0 评论 -
shell编程(一)
沈超:微博:weibo.com/lampsc shell编程(一) 一 shell简介 1 概念 命令解释器 2 常见shell bash linux标准shell sh 早期shell,较简单 csh ksh tcsh unix shell vi /etc/shells linux支持的shell 3 shell脚本 例1:打印时间#!/bin/ba...转载 2018-03-10 05:35:36 · 217 阅读 · 0 评论 -
环境变量 和bash 子父
123456[wangshumin@CentOSNode3 ~]$ pstreesystemd─┬─ModemManager───2*[{ModemManager}] ├─NetworkManager───2*[{NetworkManager}] ├─VGAuthService ├─abrt-dbus───2*[{abrt-dbus}] ├─...原创 2018-03-10 05:30:43 · 292 阅读 · 0 评论 -
变量
[wangshumin@CentOSNode3 ~]$ echo $aa[wangshumin@CentOSNode3 ~]$ bb="hello world"[wangshumin@CentOSNode3 ~]$ echo bbbb[wangshumin@CentOSNode3 ~]$ echo $bbhello world[wangshumin@CentOSNode3 ~]$ bb=hell...原创 2018-03-10 05:17:17 · 201 阅读 · 0 评论 -
&& || | > >> &
[wangshumin@CentOSNode3 ~]$ cd shell/[wangshumin@CentOSNode3 shell]$ ll总用量 4-rw-rw-r--. 1 wangshumin wangshumin 33 3月 10 04:12 shelltest1[wangshumin@CentOSNode3 shell]$ echo hh >> shelltest1 [w...原创 2018-03-10 05:07:37 · 238 阅读 · 0 评论 -
vi 查询
原创 2018-03-09 18:00:40 · 662 阅读 · 0 评论 -
shell 脚本判断分支
wangshumin@machine2:~$ cat test3#!/bin/bashecho "v1=?????"read v1if [ 10 = $v1 ] ;then echo "v1=$v1" elseecho "$v1....."fi wangshumin@machine2:~$ sh test3v1=?????10v1=10wangshumin@machine2:~$ ...原创 2018-03-09 17:25:29 · 929 阅读 · 0 评论 -
shell 判断文件的读写权限和存在 test命令
wangshumin@machine2:~$ wangshumin@machine2:~$ vim testwangshumin@machine2:~$ sh testnot exitwangshumin@machine2:~$ sh testnot exitwangshumin@machine2:~$ sh testnot exitwangshumin@machine2:~$ cat test...原创 2018-03-09 17:09:24 · 2634 阅读 · 0 评论 -
shell 字符串变量的截取
wangshumin@machine2:~$ wangshumin@machine2:~$ vim sh2wangshumin@machine2:~$ sh sh212shumin wwangshumin@machine2:~$ vim sh2wangshumin@machine2:~$ sh sh212shumin wshumin wwangshumin@machine2:~$ vim ...原创 2018-03-09 16:45:01 · 310 阅读 · 0 评论 -
shell 加减 剩除
wangshumin@machine2:~$ &namebash: 未预期的符号 `&' 附近有语法错误wangshumin@machine2:~$ name=wangshumin1wangshumin@machine2:~$ vim shwangshumin@machine2:~$ sh shwangshuminwangshumin@machine2:~$ mv sh sh1...原创 2018-03-09 16:26:13 · 314 阅读 · 0 评论 -
eclipse各插件安装
eclipse各插件安装2018年04月04日 23:26:35阅读数:2431.安装maven插件:.打开eclipse,help->install new software add: name:maven名字随便取;Location:http://download.eclipse.org/technology/m2e/releases官网下载maven压缩包apache-maven-3...转载 2018-05-22 10:45:25 · 624 阅读 · 0 评论