OpenWrt/shell

OpenWrt 默认使用 ash Shell, 与 sh 兼容(存在 /bin/sh )。

ash 的用户 shell profile 脚本是 /root/.profile , 在这里定义环境变量和用户初始化脚本:

ulimit -n 65535

export PATH=$PATH:/root/files/scripts:/root/files/bin:/root/storage/files/scripts:/root/storage/files/bin
export PATH=$PATH:/root/storage/rootfs/usr/bin:/root/storage/rootfs/usr/sbin:/root/storage/rootfs/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/storage/rootfs/usr/lib:/root/storage/rootfs/lib

系统启动脚本 ( /etc/rc.local ) 里如果需要使用非标准位置软件包,也需要先设置环境变量。


Last update: 2020-12-30 07:40:03 UTC