码迷,mamicode.com
首页 > 系统相关 > 详细

shell常识总结

时间:2015-10-19 17:03:35      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:

#!/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

...

shell常识总结

标签:

原文地址:http://www.cnblogs.com/biglucky/p/4892254.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!