Quick question guys. Is 2>&1 > details.txt intended to display the error on the screen as well as redirect STDOUT and STDERR to details.txt? If yes, it doesn't appear to work although 2>&1 | tee details.txt does. Why is that?
@MichaelHomer That's what i thought i.e. redirect STDOUT and STDERR to details.txt
@MichaelHomer If i run a simple test of ll /root/ 2>&1 > details.txt, the file is empty. If i run the command ll /root/ 2>&1 | tee details.txt the output is ls: cannot open directory '/root/': Permission denied. The file captures it as well.
First command will do the another task:
After
2>&1 > output.log
the old STDOUT will be saved (copied) in STDERR and then STDOUT will be redirected to file.
So, stdout will go to file and stderr will go to console.
And in
2>&1 | tee output.log
both streams will be redirected to tee. Te...
I'm sure we have a canonical question about this somewhere but it's not the one I thought it was
I often see tutorials online that connect various commands with different symbols. For example:
command1 | command2
command1 & command2
command1 || command2
command1 && command2
Others seem to be connecting commands to files:
command1 > file1
command1 >> file1
What are these things?...
@Motivated Redirections are processed in a left-to-right order. This means that "2>&1 > details.txt" will first redirect the standard error stream to wherever the standard output stream is going, and then redirect standard output to a file. The standard error stream will not be redirected to that file.
Since standard error and output are both going to the console by default, and assuming no redirections of either stream happens before or after this (for example through a later pipe), this would have the same visible effect as ">details.txt".
I wanted to know the difference between the following two commands
2>&1 > output.log
and
2>&1 | tee output.log
I saw one of my colleague use second option to redirect. I know what 2>&1 does, my only question is what is the purpose of using tee where a simple redirection ">" operator can ...
Redirections are handled in a left-to-right manner.
utility 2>&1 >output.log
Here, the standard error stream would first be redirected to wherever the standard output stream goes (possibly to the console), and then the standard output stream would be redirected to a file. The standard error ...
Hi everybody! @Kusalananda Do you think it would be possible to better define "wherever the standard output stream goes"? (I'm of course referring to unix.stackexchange.com/a/495731/315749)
E.g. On my system I can run cat - and see that /proc/<pid of cat>/fd/1 is a symbolic link to /dev/pts/1, while if I run >somefile cat - I can observe that /proc/<pid of cat>/fd/1 is a symbolic link to /path/to/somefile. In this context it looks like 2>&1 cat - means "link cat's file descriptor 2 to what nowcat's file descriptor 1 is linked to".
This may be inaccurate and/or not general, or even outright wrong... but I feel this kind of example would help understanding what redirection does.
@fra-san if you have comments on a specific post, IMO it’s better to comment on the post directly rather than in chat: it means that other readers will see the comments, and also that the person you’re addressing can find the comments more easily.
@StephenKitt I agree, I just felt my comment would have been too long and noisy to be appropriate as a comment to the answer. I will see if I can shrink it and make it useful there.
Hello. CentOS 7.5, gpm not installed, but mouse works in jed, mc, micro, tmux, htop, etc. yum list installed | grep gpm says gpm-libsis installed. Is this enough for the mouse support? I thought gpm daemon was needed for mouse support. Thank you for any info.
@data OK, so it’s probably your local terminal interpreting mouse clicks and sending the corresponding xterm codes to the target, no gpm required in that case
Comments from Perl users? See particularly the most recent comments - github.com/plk/biber/issues/247 . This isn't terribly important, but does strike me as a bit odd.
@StephenKitt Are you a Perl user? @derobert, @terdon I know you are Perl users.
@FaheemMitha it seems to me you could try patching Biber to not require 5.26, and adjust the Debian package likewise — its unit test coverage seems to be comprehensive enough for the resulting package to be trustworthy (if everything passes).
@StephenKitt Surely that's not the only reason for requiring 5.26. That commit basically just renames everything. And did you see my last comment about Perl libraries?
If you want a better sort algorithm (or whatever it is), do you really need to upgrade Perl from 5.24 to 5.26?
@FaheemMitha as dcpurton says, you need to wait for plk’s input for the reason to use 5.26. If the requirement is on a base module, you need to upgrade Perl, not just a library.
@StephenKitt I actually tried that. And all the unit tests failed.
But it might be some configuration issue. It seems unlikely that a downgrade would break everything. I haven't investigated the unit tests. The maintainer is a little... volatile and emotional, which is why I haven't asked him already. Maybe he's stressed.
@FaheemMitha The new features in .26? I'm saying they won't be very big differences. But can you please check your script and tell us what the actual versions are? You say "Biber requires Perl 2.26, and the version in Debian stable is only 2.24" but even if I assume you mean 5.24 and 5.26, you then show a perl script that requires 5.24 and not 5.26
I want to install, from source, Perl versions 5.005, v5.6, v5.8, v5.10
Right now I have 'v5.10.0' installed.
/opt/perl/bin
/opt/perl/html
/opt/perl/lib
/opt/perl/man
/opt/perl/lib/5.10.0
/opt/perl/lib/site_perl
/opt/perl/lib/site_perl/5.10.0
Will I have any problems if I install them all i...
@terdon Just to expand on my previous response. I've found stable works well for me, for a long time. Once things were changing sufficiently fast that one felt really behind using stable. But it's not like that these days. And most things one is interested in are leaf packages, anyway.
So they are often/usually trivial to backport if you want to do so, even complicated stuff.
@Kusalananda Thanks for clarifying that Kusalananda.
@Kusalananda Could you further clarify what you meany by "assuming no redirections of either stream happens before or after this (for example through a later pipe), this would have the same visible effect as ">details.txt".?
@Fabby I ended up backing up my files and deleting my user, then recreating it. I added files back into my new /home directory incrementally to determine what breaks stuff, and it looks like it was my .bashrc or .bash_profile. It works now.
Thank you for your help! I didn't think of making a new user to test.