use*_*938 8 unix bash cut pipe cat
我有以下命令:
httpd.conf | grep AuthUserFile | cut -d" " -f4 | sed -e 's|["'\'']||g'
Run Code Online (Sandbox Code Playgroud)
其输出是:
/etc/httpd/secure/htpasswd.training
Run Code Online (Sandbox Code Playgroud)
我做了:
httpd.conf | grep AuthUserFile | cut -d" " -f4 | sed -e 's|["'\'']||g'| cat
Run Code Online (Sandbox Code Playgroud)
然而这刚刚返回:
/etc/httpd/secure/htpasswd.training
Run Code Online (Sandbox Code Playgroud)
我想抓取文件的内容。我该怎么做呢?
管道传输到xargs cat
将把 stdin 作为参数传递给cat
,打印文件。
或者尝试:cat $( some command printing a filename )
.