Sponsored Content
Top Forums UNIX for Dummies Questions & Answers exec command and field descriptors.. Post 58916 by Perderabo on Saturday 4th of December 2004 04:01:36 AM
Old 12-04-2004
If you write a script, you can send input into it like this:

./somescript < inputfile

The script can accomplish the same thing internally by using:
exec < inputfile

After that line, the script's input is inputfile. It can do the same to output:

exec > somescript.log 2>&1

This send stderr and stdout combined into the file. There is more to it, but this is the basics.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using the -exec command

linux redhat 8.0 I am getting accustomed to using the -exec command to get around my databse.. and use it to edit and update files..! is this more apllicable than jumping from one directory to the other.. I have set up the databse so that the inode #'s are accessable and can get me from one... (0 Replies)
Discussion started by: moxxx68
0 Replies

2. Shell Programming and Scripting

Help with exec command and file descriptors??

im having trouble with the comprehending the exec command and the use of file descriptors. given: #!/bin/sh exec 4>&1 exec 1>&2 exec 2>&4 exec 4>&- echo Hello would the standard output of this script be sent to STDOUT, STDERR or neither and why??? thanks for the help. (1 Reply)
Discussion started by: rfourn
1 Replies

3. Shell Programming and Scripting

Help with exec command and file descriptors II

Need to close files which descriptor number are larger than 9 in ksh. 'exec 10>&-' fails with 'ksh: 10: not found'. How do you specify file descriptors which occupies two or more digits in ksh script? Thanks, Masaki (2 Replies)
Discussion started by: masaki
2 Replies

4. Shell Programming and Scripting

exec command

can any one pls explain the meaning of exec 1<&5 ?? its urgent (2 Replies)
Discussion started by: santosh1234
2 Replies

5. HP-UX

exec and file descriptors

Hi, I speak and write english more or less, so I hope my asking be clear. :) In the company I am working, they are using control-m software to lunch shell scripts. So i put this command in all shell scripts: export LOGFILE_tmp=$PRODUC_DATA/tmp/${SCRIPT}_${PAIS}_`date... (0 Replies)
Discussion started by: anamcara
0 Replies

6. UNIX for Dummies Questions & Answers

Exec command

Hi can some one explain the following command , It would really help if some can really elloborate on what is happening out here export PATH | exec /bin/sh ./auto_approve :q P.S: This is the first time i am using exec ,so an elloboration what does it do and what is the use of the :q will be... (1 Reply)
Discussion started by: Sri3001
1 Replies

7. Shell Programming and Scripting

exec command help

Hi, I have the following lines in a script : . . exec < some_file . . . I have very little idea about exec command. I would like to know what this does and what will happen if the file some_file does not exist. Specifically, I would like to know whether the lines following this... (5 Replies)
Discussion started by: elixir_sinari
5 Replies

8. Shell Programming and Scripting

Use 3 descriptors with ssh command

Hi, I want to execute some commands via ssh. errupdate <enter> =5A7598C3: <enter> Report=False <enter> Log=False <enter> <CTRL + D> <CTRL + D> how can i do this ? I suppose i have to use file descriptor but i don't know how ? Thank you (2 Replies)
Discussion started by: khalidou13
2 Replies

9. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

10. Shell Programming and Scripting

Linux find command seems to not transmit all the result to the '-exec command'

Hello. From a script, a command for a test is use : find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc' Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies
LOCALEDEF(1)							   GNU C Library						      LOCALEDEF(1)

NAME
localedef - compile locale definition files SYNOPSIS
localedef [-f charmapfile] [-i inputfile] [--force] [--verbose] [--posix] [--quiet] outputpath localedef --version localedef --help DESCRIPTION
The localedef program reads the indicated charmap and input files, compiles them to a form usable by the locale(7) functions in the C library, and places the six output files in the outputpath directory or in one archive. If no charmapfile is given, POSIX is used by default. If no inputfile is given, or if it is given as -, localedef reads from standard input. OPTIONS
Most options can have either short or long forms. If multiple short options are used, they can be combined in one word (e.g. -cv). If an option takes an argument, the argument can be given separately as the next word, or it can be written as option=argument. -f charmapfile, --charmap=charmapfile Specify the file that defines the symbolic character names that are used by the input file. If the file is in the default directory for character maps, it is not necessary to specify the full pathname. This default directory is printed by localedef --help. -i inputfile, --inputfile=inputfile Specify the locale definition file to compile. If inputfile is not absolute, localedef will also look in the directory specified by the environment variable I18NPATH and in the default directory for locale definition files. This default directory is printed by localedef --help. -c, --force Write the output files even if warnings were generated about the input file. -v, --verbose Generate extra warnings about errors that are normally ignored. --quiet Suppress all notifications and warnings, and report only fatal errors. --posix Be strictly POSIX conformant. Implies --verbose. This option currently has no other effect. Posix conformance is assumed if the environment variable POSIXLY_CORRECT is set. -u codeset, --code-set-name=codeset This option is accepted but ignored. -h, --help Print a usage summary and exit. Also prints the default paths used by localedef. -V, --version Print the version number, license, and disclaimer of warranty for localedef. ENVIRONMENT
POSIXLY_CORRECT The --posix flag is assumed if this environment variable is set. I18NPATH The default directory for locale definition files. FILES
/usr/share/i18n/charmaps Usual default charmap path. /usr/share/locale Usual default output path. See the output from localedef --help for the paths used in your version. outputpath/LC_COLLATE One of the output files. It describes the rules for comparing strings in the locale's alphabet. outputpath/LC_CTYPE One of the output files. It contains information about character cases and case conversions for the locale. outputpath/LC_MONETARY One of the output files. It describes the way monetary values should be formatted in the locale. outputpath/LC_MESSAGES/SYS_LC_MESSAGES One of the output files. It contains information about the language messages should be printed in, and what an affirmative or nega- tive answer looks like. outputpath/LC_NUMERIC One of the output files. It describes the rules for formatting numbers in the locale. outputpath/LC_TIME One of the output files. It describes the rules for formatting times and dates in the locale. SEE ALSO
locale(5), locale(7), locale(1) AUTHOR
The program was written by Ulrich Drepper. This manpage was written by Richard Braakman <dark@xs4all.nl> on behalf of the Debian GNU/Linux Project and anyone else who wants it. The manpage is not supported by the GNU libc maintainers and may be out of date. It does only descripe the important functions and is far from being complete. STANDARDS
This program conforms to the POSIX standard P1003.2 Feburary 07, 2003 2.3 LOCALEDEF(1)
All times are GMT -4. The time now is 06:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy