下面的(简化的)shell脚本在我的mac上mojave (10.14.6)上运行得很好,但我得到了一个错误信息OS Yosemite (10.10.5)
DB_FULL_PATH=/Volumes/path
find $DB_FULL_PATH -type f| while read f; do
< <(stat -f %Sm -t "%m %V %d" $f) read -s MONTH WEEK DAY
echo $MONTH $WEEK $DAY
done错误:
test.sh: line 17: syntax error near unexpected token `<'
test.sh: line 17: ` < <(stat -f %Sm -t "%m %V %d" $f) read -s MONTH WEEK DAY '发布于 2020-10-07 22:40:12
<(...)是在bash上可用的bash扩展。确保在bash解释器下运行脚本。确保shebang是bash,就像#!/bin/bash或#!/usr/bin/env bash。
https://stackoverflow.com/questions/64246178
复制相似问题