我想从 bash 标准输入执行像 python 这样的脚本代码,因为我不想先将脚本写入文件。怎么办?如果我想从 bash 标准输入运行 python 代码,例如:
#!/usr/bin/env python
print 'hello world'
$cat mycode.py | 重击 -s
但它不起作用。显示错误:
Warning: unknown mime-type for "hello world" -- using "application/octet-stream"
错误:没有这样的文件“hello world”