I've made a desktop launcher and I want to direct the stderr to a file, but the redirection file isn't even create:

/home/pl/my_thing.sh 2> /home/pl/stderr.txt

That's what I've got in my launcher, but when I run it, the command executes normally, but acts as though it ignores everything from 2 onward. If I copy and paste that line into the command-line, it works. So why not in my launcher?

  • A desktop launcher in what desktop? What do you mean by "ignores everything from 2 onward"? – Kusalananda Feb 23 '18 at 15:54
  • @Kusalananda XUbuntu. I mean it acts like it's not there. It runs the command but the file isn't even created and the stderr is written to the terminal (when I select to run in one) – PenguinLust Feb 23 '18 at 16:07
  • 1
    I suspect the launcher is not run by shell, so shell redirection does not work. Put it into the .sh file itself. – 9000 Feb 23 '18 at 17:01
  • @9000 Looks like you're right. Putting the redirection into /home/pl/my_thing.sh was the answer. – PenguinLust Feb 23 '18 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.