这是我用来从相机保存文件的代码,并从0001开始命名.相机正在运行Busybox,里面有一个灰壳.
该代码是基于查尔斯·达菲先前的答案在这里.
#!/bin/sh
# Snapshot script
cd /mnt/0/foto
sleep 1
set -- *.jpg # put the sorted list of picture namefiles on argv ( the number of files on the list can be requested by echo $# )
while [ $# -gt 1 ]; do # as long as there's more than one...
shift # ...some rows are shifted until only one remains
done
if [ "$1" = "*.jpg" ]; then # If cycle to determine if argv …Run Code Online (Sandbox Code Playgroud)