linux - Utility off using an additional file descriptor? -



linux - Utility off using an additional file descriptor? -

i know can create file descriptor , redirect output it.

but can same thing without file descriptor.

when have utilize additional file descriptor.

when redirect without using file descriptor, i.e:

echo haha > dump.log

it's equivalent

echo haha 1>dump.log

1 file descriptor standard output.

2 file descriptor standard error, if want redirect error messages coming command, can utilize file descriptor

ech lol 2>dump.log

these cases need file descriptors.

for example, if writing script, contains naturally lot of commands, can utilize redirection many purposes:

log commands , execution in log file follow workflow of script log error messages in log file know if there error messages there error messages, or output want ignore, , can 'incinerate' redirecting /dev/null

linux

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -