bash - Will this redirection ">>& <filename>" work in Korn shell? -
I am trying to redirect both STDOT / STDERR of a UNIX command and into a log file in a corn shell I am attached.
rm -rf file1 >> more; Logfile
Will this command work in ksh or is it a common bad command? What can I do with the above order?
I use this form to redirect standard output and standard error in the same file .
LS-DD FREAD & gt; No_fred 2 & gt; & Amp; 1 Tested in the kernel shell of Red Hat Linux 4 only. No_fred includes:
ls: fred: There is no such file or directory drwxrwxr-x 2 user group 1024 April 27 17:41. ">" is actually 1>, which asks to redirect the file descriptor 1 (standard output). "2>" Standard error redirects, because the standard error file descriptor is 2. "And 1" means "whatever you are doing with file descriptor 1". So all together, this means "Standard output dump in a file and standard error with it."
One advantage of this method is that error messages appear in the right place, for example, a compiler error message that fails to compile the file, immediately after the compile command from your makefile Will appear.
>> And & amp; The creation can attach the output of the command to the log file, and keep it in the background; I'm not sure that it does anything with standard error. I only consulted Bolsky / Corn 1989, and it is not there either , So maybe someone else can parse. The standard error of the initial step will first appear, because the error generator command runs. Since only the standard output is made through the pipes, so this will all appear at once, when the entire pipeline will be completed.
Comments
Post a Comment