Redirect to file directory does not exist

I call this command in Python:

os.system('echo %s  > `find $HOME -iname p410.yaml`' % string)

This works fine on OSX, but on Ubuntu it gives me /home/path/to/p410.yaml: Directory nonexistent. However, I can edit the file along the path that it gave me using vim.

Any idea what?

EDIT

Output from stat 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: -
+4
source share
1 answer

The problem was that there were two files with the same name that were slightly obscured through the error messages that were passed through the Python interpreter. Honestly, I am also surprised that when I called vim 'find $HOME -iname p410.yaml', it worked when there were two options for opening a file.

0
source

Source: https://habr.com/ru/post/1568571/


All Articles