LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-18-2011, 11:03 PM   #1
Ram Kankanampati
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
/dev/tty: No such device or address ? Answer


My shell script worked fine when I run it from putty. But when I try to call same shell script from crontab, it didn't work and throws "/dev/tty: No such device or address". After I spent almost 5 hours, then fixed this error by using
GPG option "--no-tty" fixed my problem.
Here is sample command.
echo "filepassphrase" | gpg --no-tty --passphrase-fd 0 --output $newfilename -d $originalfilename

Thanks,
Ram Kankanampati
Cognizant
 
Old 09-19-2011, 09:09 AM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Welcome to LQ!

MOD suggestion;
Quote:
  • Do not post if you do not have anything constructive to say in the post.
  • When posting in an existing thread, ensure that what you're posting is on-topic and relevant to the thread. If the content of your post will interfere with the current discussion, you should start a new thread.
  • Your thread may be moved to a more appropriate forum at a moderator's discretion.
Your post has been moved to a new thread since you posted to a five year old post (resurrection) with a solution for your problem not the Original Post(OP). Please re-read the above LQ rules. You might want to re-read the entire LQ Rules set to be sure that no rules will be violated for future posts.

Again, your post is a answer to your problem not OP's. Hopefully other members may add to your thread.
 
Old 09-21-2011, 03:55 AM   #3
greenleaf
Member
 
Registered: Feb 2004
Location: Chester, UK
Distribution: Linux From Scratch. 64 bit. Kernel 5.8.3. Fluxbox.
Posts: 53

Rep: Reputation: 22
Well, its nice to see that you found a solution, Ram.

Generally speaking, crontab runs with a different environment than the one that is set for your shell (e.g. bash). So various things, like environment variable values, have to be provided, otherwise commands that (implicitly) refer to those variables will not function as expected.

Of course since crontab can run whilst you are not logged in, it doesn't have an associated teletype, so the linux device /dev/tty would not be available to gpg.

A knock-on effect of the changes in environment values is that is usually best to specify full paths in your scripts.

I wonder if the error messages were coming to you via your email.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ultrium 2 - multi-tape error (DUMP: fopen on /dev/tty fails: No such device or addres tbwalter55 Linux - Hardware 2 01-08-2015 08:05 AM
cpio: /dev/tty: No such device or address dougbourne Linux - Server 6 10-09-2008 12:28 PM
/dev/tty: No such device or address ? dkennedy Linux - General 2 08-01-2006 11:28 AM
dd: /dev/hda: No such device or address securehack Linux - General 97 06-04-2005 07:27 PM
loop: can't open device /dev/loop0: No such device or address miaviator278 Linux - Security 3 06-09-2004 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration