LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 02-27-2012, 09:18 AM   #1
DieZwiebel
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?

Code:
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

Code:
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
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
  


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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 AM.

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