0

I am getting a you must have a tty to run sudo error when I run a shell script with a R script in it.

Weird thing is, it doesn't happen every time. I think it is because of RAM issue, but I am not sure.

halfer
  • 19,824
  • 17
  • 99
  • 186
karan arora
  • 176
  • 9
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Jul 11 '17 at 12:23
  • A now-deleted answer linked [to this resource](//unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password). – halfer Jul 11 '17 at 15:26

1 Answers1

0

This means that you are running on a Linux distribution with 'sudo' configured to require a tty.

Please refer this link for an easy fix: https://www.shell-tips.com/2014/09/08/sudo-sorry-you-must-have-a-tty-to-run-sudo/

Vikas Kumar
  • 87
  • 2
  • 18
  • Your other answer was deleted for being link-only. I've not reported this one as it has some detail in it, but not much. Can you expand on it at all? May we see the fix itself in the post? – halfer Jul 11 '17 at 15:25
  • Its resolved now. I have kept sudo word inside shell script , that's why it was failing with above error. After removing sudo inside the shell script, it is working fine. – karan arora Jul 12 '17 at 07:18