我在Python中调用此命令:
os.system('echo %s > `find $HOME -iname p410.yaml`' % string)
这在OSX上工作正常,但在Ubuntu上给我/home/path/to/p410.yaml: Directory nonexistent
。但是,我可以在它给我vim的路径上编辑文件。
有什么想法吗?
来自统计find $HOME -iname p410.yaml
File: `/home/aslab/chris_ws/src/pulseon_p400/config/p410.yaml'
Size: 124 Blocks: 8 IO Block: 4096 regular file
Device: 805h/2053d Inode: 460669 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1001/ aslab) Gid: ( 1001/ aslab)
Access: 2014-12-22 13:45:57.000000000 +1000
Modify: 2014-12-22 13:44:45.000000000 +1000
Change: 2014-12-22 13:44:45.000000000 +1000
Birth: -
File: `/home/aslab/uwb_ws/src/pulseon_p400/launch/p410.yaml'
Size: 163 Blocks: 8 IO Block: 4096 regular file
Device: 805h/2053d Inode: 457183 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1001/ aslab) Gid: ( 1001/ aslab)
Access: 2014-12-19 08:11:30.000000000 +1000
Modify: 2014-09-12 14:37:19.000000000 +1000
Change: 2014-09-12 14:37:19.000000000 +1000
Birth: -
答案 0 :(得分:0)
这里的问题是有两个具有相同名称的文件,通过Python解释器过滤的错误消息有点模糊。说实话,我也很惊讶当我打电话vim 'find $HOME -iname p410.yaml'
时,它有两个选项可以打开。