LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-30-2012, 05:18 AM   #1
leniviy
Member
 
Registered: Jul 2009
Distribution: Archlinux
Posts: 69

Rep: Reputation: 4
exec $next_available_file_descriptor > &1;


In bash you can assign a new file number to stdout:
Code:
exec 3>&1
It's like the "dup2" system call.

But is there a way to assign an automatic file number?
Is there an analog of "dup"?

I can only think of scanning /dev/fd for the next available number
 
Old 11-30-2012, 05:35 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
The bash source code is where I would look for this.
 
  


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
Best language / solution for this scenario (web-ui & cli scripts exec) fruitwerks Programming 2 07-31-2010 06:21 AM
Use of find & exec andrew_26 Linux - Newbie 2 08-26-2009 06:15 PM
exec cmd=perl... work but exec cgi doenst crions Slackware 5 12-09-2005 12:17 PM
wait & exec bisDude Programming 4 11-02-2005 11:25 AM
what is the difference between Fork & exec augustus123 Linux - Newbie 1 11-29-2004 07:32 AM

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

All times are GMT -5. The time now is 01:04 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