标签:
#!/bin/bash cmd="ls -lt | grep ^d | awk ‘NR==1 {print $9}‘" $cmd
这是一个获取文件夹名字的脚本,但是却提示:
ls: cannot access |: no such file or directory
ls: cannot access grep: no such file or directory
ls: cannot access ^d: no such file or directory
ls: cannot access awk: no such file or directory
...
标签:
原文地址:http://www.cnblogs.com/biglucky/p/4892254.html