【新手学堂:Linux操作系统Shell基础知识】1 cat /etc/shells 查看计算机上可用的shell 2 编写shell,保存为firstscript #! /bin/bash# This is a test.echo -n Your current directory is:pwdecho $HOMEecho Your current directory is:pwd#END.3 运行firstscript $ /bin/bash firstscript 如果找不到文件 使用pwd查看当前目录 $ /bin/bash pwd/firstscript 可见当前运行结果 。4 可以修改firstscript为执行 $chmod a x firstscript 此时输入$ ./firstscript即可 上面的shell没有交换,我们可以进行交互,如下: #!/bin/shecho -n Please input your ID:read id_varecho -n Please input your password:read passwordecho User ID = $id_varecho password = $passwordif [ $password = "admin" ]; thenecho "password is right"elseecho "password is wrong"fi同前面的运行,自己测试 。
- 微软: Vista中UAC值得所有操作系统效仿
- 微软Windows Vista操作系统实用小技巧
- 微软称Vista的UAC值得所有操作系统效仿
- 金无足赤 Vista操作系统新功能的瑕疵
- 在Vista下安装老版本操作系统做双启动
- 高手必备!Vista操作系统经典绝技揭密
- 8GB变3GB--Vista操作系统精简安装大法
- Windows Vista操作系统新增组策略详解
- Vista操作系统中的《魔兽世界》之旅
- 下一代操作系统Windows Seven独家解密
