Arguments with spaces in watch command are incorrectly split
koterpillar opened this issue · 2 comments
koterpillar commented
This command gives the tabular output with details:
$ bash -c 'ls -l'
total 0
-rw-r--r--. 1 user user 0 Aug 5 17:23 a
-rw-r--r--. 1 user user 0 Aug 5 17:23 b
-rw-r--r--. 1 user user 0 Aug 5 17:23 c
However, Viddy breaks it, and -l
is passed to bash
, not ls
:
viddy bash -c 'ls -l'
This behavior is present in traditional watch
, but I don't actually see a reason for it.
koterpillar commented
Here the arguments are joined together, which causes the incorrect behavior if some arguments already contain spaces:
https://github.com/sachaos/viddy/blob/0ab3347/snapshot.go#L110
phanirithvij commented
viddy "bash -c 'ls -l'"
watch "bash -c 'ls -l'"