小编Dav*_*erf的帖子

带有选择命令的 Shell 脚本以显示文件列表

我已经编写了附加的bstls.shshell 脚本,它使用命令 select 来选择作为参数传递的文件夹中的子文件夹或文件,执行 ls 命令。

#! /bin/bash
#Personal version of shell command ls which presents to user the list of files with shell command select
#Usage: bstls.sh folder

#if parameter numbers is different from one, exit
if [ $# -ne 1 ]
then
    echo -e "Usage:\n\tbstls folder"
    exit 1
fi

PS3='Which element to ls?'
#command sed substitutes blank spaces with £ in file or folder names
#in this way user can select files or folders with blank …
Run Code Online (Sandbox Code Playgroud)

command-line bash scripts filename

2
推荐指数
1
解决办法
6473
查看次数

标签 统计

bash ×1

command-line ×1

filename ×1

scripts ×1