1

I am trying to use echo in GeekTool to print text without a newline like this: echo -n "test"

When I run that command in Terminal it prints this: test In geek tool it prints this: -n test

What is going on and how can I fix it?

1

After some experimenting, I've found that GeekTool seems to replace the token "echo" with an internal function that doesn't accept the -n switch.

One solution: Give GeekTool the full path to echo(1). For example, /bin/echo -n "test" works where echo -n "test" does not.

0

printf tends to be more portable than echo. Does this work?

printf "%s" test
-1

First GeekTool isn't a Shell its a Monitoring Tool which has a Shell mode plugin to use Scripts/Commands to get Information you can't get otherwise. Second if you would have done a simple man echo you should have seen that echo is a Shell builtin command so there is no actual executable.

Thats why GeekTool don't use the same echo (it simply can't cause it's a Shell builtin) so they made there own builtin echo command.

Now a little Question to maybe help you with your Struggling do you really need echo?

Maybe it is possible for you to paste the command you like to use and describe the result you'd like to get?

Then we can help you more.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .