使用 read 命令来接受输入 使用read来把输入值分配给一个或多个shell变量,read从标准输入中读取值,给每个单词分配一个变量,所有剩余单词都被分配给最后一个变量,如果变量名没有指定,默认标准输入的值赋值给系统内置变量REPLY 格式: read [options] [name ...] ...
分类:
系统相关 时间:
2020-07-06 22:43:47
阅读次数:
107
登录脚本的执行顺序:【注:仅适用于 bash shell】 Login-Shell 是指登录时,需要提供用户名密码的shell,如:su – user1 , 图形登录, ctrl+alt+F2-6进入的登录界面。 这种Login shell 执行脚本的顺序: 1./etc/profile 【全局pr ...
分类:
系统相关 时间:
2020-07-06 15:56:25
阅读次数:
120
dbbac.sh #!/bin/bash # db_user="teacher" db_password="123456" ftp_user="teacher" ftp_password="123456" ftp_host="192.168.199.230" dest_dir="/root/mysq ...
分类:
数据库 时间:
2020-07-06 13:03:48
阅读次数:
62
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ...
分类:
系统相关 时间:
2020-07-06 12:57:01
阅读次数:
69
phpinfo() 功能描述:输出 PHP 环境信息以及相关的模块、WEB 环境等信息。 危险等级:中 passthru() 功能描述:允许执行一个外部程序并回显输出,类似于 exec()。 危险等级:高 exec() 功能描述:允许执行一个外部程序(如 UNIX Shell 或 CMD 命令等)。 ...
分类:
Web程序 时间:
2020-07-06 11:21:28
阅读次数:
73
shelljs https://github.com/shelljs/shelljs 实例 var shell = require('shelljs'); if (!shell.which('git')) { shell.echo('Sorry, this script requires git') ...
分类:
Web程序 时间:
2020-07-06 11:12:54
阅读次数:
98
脚本源码:#!/bin/bashecho_caidan() {# 清空防火墙规则read -ep "是否清空防火墙规则(y/n):" nameif [ $name == y ];then iptables -F echo " 1) 放行端口 2) 封锁端口 3) 放行ip 4) 封锁ip "else... ...
分类:
系统相关 时间:
2020-07-06 11:04:21
阅读次数:
99
<template> <div class="hello"> <div class="specs" v-for="(item,index) in arrList" :key="index"> <div>{{item.name}}:</div> <div class="spec" v-for="(it ...
分类:
其他好文 时间:
2020-07-06 10:54:38
阅读次数:
118
1、统计出/etc/passwd文件中其默认shell为非/sbin/nologin的用户个数,并将用户都显示出来[root@centos7~]#grep-v"/sbin/nologin"/etc/passwd|cut-d:-f1rootsyncshutdownhaltzjwmageiaslackware2、查出用户UID最大值的用户名、UID及shell类型[root@centos7~]#get
分类:
其他好文 时间:
2020-07-06 01:02:16
阅读次数:
69