fd2 man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

FD2(1)			       General Commands				FD2(1)

NAME
       fd2 - redirect from/to file descriptor 2

SYNOPSIS
       fd2 [-e] [-f file] [--] command [arg ...]

DESCRIPTION
       Since  the  Sixth  Edition  UNIX	 shell provides no way to redirect the
       diagnostic output, fd2 makes this possible by executing	the  specified
       command	with  the  given  arguments  and redirecting file descriptor 2
       (standard error) to file descriptor 1 (standard output) by default.

       The options are as follows:

       -e     Causes all conventional output from command to be redirected  to
	      the standard error as diagnostic output.

       -f file
	      Causes  all  diagnostic  output from command to be redirected to
	      file, which is created if it does	 not  exist.   If  it  already
	      exists, all diagnostic output is appended to the end of file.

       --     Causes  fd2  to  stop  further  option processing, forcing it to
	      treat all following arguments as command [arg ...] .

EXIT STATUS
       If fd2 detects an error, it prints an appropriate diagnostic and	 exits
       with a non-zero status.	Otherwise, the exit status is that of the exe‐
       cuted command.

ENVIRONMENT
       EXECSHELL
	      If set to a non-empty string, the	 value	of  this  variable  is
	      taken  as the path name of the shell which is invoked to execute
	      the specified command when it does not  begin  with  the	proper
	      magic number or a `#!shell' sequence.

       PATH   If  set  to  a  non-empty	 string, the value of this variable is
	      taken as the sequence of directories which is used to search for
	      the specified command.

EXAMPLES
       The  examples below which refer to `/tmp/$$' assume that this directory
       exists and is writable by the user.  The following command line:

	     fd2 -e echo progname: Error message

       causes all conventional output from echo to be redirected to the	 stan‐
       dard error as diagnostic output.	 The following command line:

	     fd2 make foo >/tmp/$$/foo.outerr

       causes  all  conventional  and  diagnostic output from make to be redi‐
       rected to the file `/tmp/$$/foo.outerr', which is first created by  the
       shell.  In contrast:

	     fd2 -f /tmp/$$/foo.err make foo >/tmp/$$/foo.out

       causes	all   conventional   output  to	 be  redirected	 to  the  file
       `/tmp/$$/foo.out', which is created by the shell.  All diagnostic  out‐
       put  is	redirected  to the file `/tmp/$$/foo.err', which is created by
       fd2 if it does not already exist.

SEE ALSO
       osh(1), sh6(1)

       Osh home page: http://v6shell.org/

AUTHOR
       This implementation of fd2 is written by Jeffrey Allen Neitzel.

LICENSE
       See  either  the	 LICENSE  file	which  is  distributed	with  osh   or
       http://v6shell.org/license/ for full details.

COPYRIGHT
       Copyright (c) 2005-2016
	    Jeffrey Allen Neitzel.  All rights reserved.

       Copyright (c) 1985, 1989, 1991, 1993
	    The Regents of the University of California.  All rights reserved.

osh-20160108			January 7, 2016				FD2(1)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net