Skip to content
Advertisement

BASH – weird characters coming out from a pipe

I have this script which simply kills an app

JavaScript

If I write the kill command manually as a oneliner than it works. But I have to run it as a script which doesn’t work. So I tried to debug it and here is the result

JavaScript

Why do I keep getting those strange characters on the kill line? How can i get rid of them?

Advertisement

Answer

Might be the case is number of pid’s returned are more than 1 Change your line to

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement