script.sh
来源:互联网 发布:数据修炼系统顶点 编辑:程序博客网 时间:2024/06/02 02:03
编写script.sh
1.script.sh /mnt/usrfile /mnt/passfile
2.当要建立的用户已经存在不作任何操作
3.当脚本后所指定的文件个数少于2个
please give me userfile or passwd file
4.当所给文件的行数不一致
/mnt/userfile's line is different /mnt/passwdfile's line
脚本如下:
#!/bin/bash
while [ " $# " -lt " 2 " ]do
echo "please give me userfile or passwd file"
exit 1
done
if [ $NAME -ne $PASSWD]
echo "/mnt/userfile's line is different /mnt/passwdfile's line"
exit 1
done
else
then
for NUM in `seq $NAME `do
NAME=`sed -n ${NUM}p $1`
PASSWD=`sed -n ${NUM}p $2`
id $NAME &>/dev/null
useradd $NAME &>/dev/null
echo $PASSWD |passwd --stdin $NAME &>/dev/null
fi
done
阅读全文
0 0
- script.sh
- script.sh
- script.sh
- script : check_conn.sh
- 编写 script.sh练习题
- shell script lsco_restore.sh
- script.sh脚本实现功能
- script 的运行方式差异 (source, sh script, ./script)
- shell script执行方式差异(source, sh script, ./script)
- sh script: 控制文件调用 nohup 命令
- 脚本练习-Script.sh批量创建用户
- shell中source和sh script的区别
- HowTo: Run the .sh File Shell Script In Linux / UNIX
- iOS开发之Documentation.build/Script-BC552B3A15.sh:
- sh
- What is the difference between ./ and sh to run a script?
- [解决方法]shc -f xxx.sh shc: invalid first line in script
- /Debug-iphonesimulator/✖️✖️.build/Script-817CB3AD1B3BC68D0004AFEA.sh: line 2: ./.../.framework
- github Permission denied (publickey). fatal: Could not read from remote repository.
- python写算法题:leetcode: 22. Generate Parentheses
- 初次接触到react-native,遇到的两个失误
- QML实现窗口拖拽与阴影
- node 连接mongodb ---小白入门
- script.sh
- PHP--每日十个数组函数的学习
- 关于DCMTK中像素存储以及getoutdata()函数的使用
- HIVE SQL 的三种查找当前日期
- JAVA 日期工具类使用总结
- 444. Sequence Reconstruction
- Linux进程间通信::读写特性和匿名管道的应用(协同进程实例)
- Android模块化开发中jar包对应的res中.9图片的处理方法
- linux嵌入式产品破解终端及telnet密码