Escaping commas #845
-
I cannot find a simple example of how to escape commas in a command: const ports = [3000,4000,5000];
const portsList = ports.join(',');
$`kill -9 $(lsof -ti:${portsList})`; result: kill -9 $(lsof -ti:$'3001,4001,4002') expected: kill -9 $(lsof -ti:3001,4001,4002) Which of course is invalid. A concise example would be amazing for myself and everyone else. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hmm... maybe we should add the comma char to the whitelist. |
Beta Was this translation helpful? Give feedback.
-
The Please, read the https://google.github.io/zx/quotes. |
Beta Was this translation helpful? Give feedback.
-
Found a work around. Thank you though! |
Beta Was this translation helpful? Give feedback.
The
kill -9 $(lsof -ti:$'3001,4001,4002')
is exactly the same askill -9 $(lsof -ti:3001,4001,4002)
and totally valid.Please, read the https://google.github.io/zx/quotes.