Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-27-2012, 09:18 AM   #1
LQ Newbie
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
[bash] sudo: preserve non-std file descriptors

Long story short: why isn't this (simplified) sample working?

root:# sudo -C 3 -u regular-user cat /dev/fd/3 3< /var/log/syslog
cat: /dev/fd/3: No Such file or directory
There is a file that contains

Defaults closefrom_override
in my /etc/sudoers.d

I am using bash 4.2.20 and Debian Wheezy

Thank you so much for your help!
Old 02-27-2012, 09:41 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
AFAIK the special file name /dev/fd/3 can only be used in redirections. If that is correct it cannot be used as an argument to cat. Maybe cat </dev/fd/3 would work.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
reading and writing to pipes, file descriptors, and file streams cmartin0 Programming 1 02-13-2012 03:03 AM
[SOLVED] Don't Understand Duplicate File Descriptors in Bash dcparris Linux - Server 3 12-28-2011 11:27 PM
[SOLVED] [bash] redirect all subsequent std output to file hashbang#! Programming 4 02-11-2010 05:01 PM
bash script to preserve only first digits alenD Linux - Software 6 04-14-2008 12:51 PM
BASH scripting: confused about redirection & file descriptors funkymunky Programming 1 06-07-2004 07:47 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:15 AM.

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