小编Ric*_*ick的帖子

在busybox sh中,不能将0填充的数字增加到8

这是我用来从相机保存文件的代码,并从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)

linux shell embedded-linux busybox ash

0
推荐指数
1
解决办法
299
查看次数

标签 统计

ash ×1

busybox ×1

embedded-linux ×1

linux ×1

shell ×1