LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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, 10: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, 10:41 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
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


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 04:03 AM
[SOLVED] Don't Understand Duplicate File Descriptors in Bash dcparris Linux - Server 3 12-29-2011 12:27 AM
[SOLVED] [bash] redirect all subsequent std output to file hashbang#! Programming 4 02-11-2010 06:01 PM
bash script to preserve only first digits alenD Linux - Software 6 04-14-2008 01:51 PM
BASH scripting: confused about redirection & file descriptors funkymunky Programming 1 06-07-2004 08:47 AM


All times are GMT -5. The time now is 06:08 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration