[iyunv@VM_139_12_tlinux ~]# which cd //内建命令,不是可执行文件
/usr/bin/which: no cd in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[iyunv@VM_139_12_tlinux ~]# type cd //判断是否是内建命令
cd is a shell builtin
[iyunv@VM_139_12_tlinux ~]# type ifconfig
ifconfig is /sbin/ifconfig
root@192.168.100.254:/root# read
23
root@192.168.100.254:/root# echo $REPLY
23
root@192.168.100.254:/root# read
hello world
root@192.168.100.254:/root# echo $REPLY
hello world
root@192.168.100.254:/root# read -p "enter a value:" N
enter a value:ok
root@192.168.100.254:/root# echo $N
ok
root@192.168.100.254:/root#
#!/bin/bash
until [ -z "$1" ]
do
echo "$@ "
shift
done
运行之
root@192.168.100.254:/data/redd/test# . shift.sh A B C
A B C
B C
C
root@192.168.100.254:/data/redd/test#
------ 控制shell执行程序的资源:ulimit
Provides control over the resources available to the shell and to processes started by it, on systems that allow such control.用来控制shell及它所产生的进程的资源。
The value of limit can be a number in the unit specified for the resource or one of the special values hard, soft, or unlimited, which stand for the current hard limit, the current soft limit, and no limit, respectively.
root@192.168.100.254:/data/redd/test# ulimit -a
core file size (blocks, -c) 0 //core文件上限
data seg size (kbytes, -d) unlimited //数据段最大值
scheduling priority (-e) 0 //调度优先级
file size (blocks, -f) unlimited //创建文件的最大值
pending signals (-i) 62822 //挂起的信号数量
max locked memory (kbytes, -l) 64 //最大锁定内存值
max memory size (kbytes, -m) unlimited //最大可用常驻内存值
open files (-n) 100001 //最大打开文件数
pipe size (512 bytes, -p) 8 //管道最大缓冲区的值
POSIX message queues (bytes, -q) 819200 //消息队列的最大值
real-time priority (-r) 0 //程序的实时性优先级
stack size (kbytes, -s) 10240 //栈大小
cpu time (seconds, -t) unlimited //最大CPU占用时间
max user processes (-u) 1024 //用户最大进程数目
virtual memory (kbytes, -v) unlimited //最大虚拟内存
file locks (-x) unlimited //文件锁