为什么这样做:
$ cat test.sh
#!/bin/bash
cat <(date|awk '{print $1}')
$ ./test.sh
Thu
Run Code Online (Sandbox Code Playgroud)
但不是作为传递给 bash 的命令:
$ bash -c "cat <(date|awk '{print $1}')"
Thu 2 Apr 2020 12:52:10 BST
Run Code Online (Sandbox Code Playgroud)
我在 macOS 上运行这个
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.
Run Code Online (Sandbox Code Playgroud)