You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cat file.txt | and < file.txt do the same exact thing. For this reason it would be beneficial to prefer using one over the other in the pages. The advantage of < file.txt would be that we don't need to involve any other commands but it's less known than piping. Thus new users might not understand what it does. If we started using it commonly, the knowledge of what it does might spread. cat file.txt | has the advantage that everyone has seen it being used.
This should not be a hardline stance. Each command should be judged case by case based on how it's most commonly written on the internet, but when in doubt this guideline could be used.
The text was updated successfully, but these errors were encountered:
Managor
changed the title
Proposal: Prefer either cat file.txt | or < file.txt in the style guide
Proposal: Mark cat file.txt | or < file.txt as preferred in the style guide
Sep 11, 2024
The "useless use of cat" IMO is only to show you can pipe stuff in while < file.txt looks a little awkward not flowing left-to-right. Many (but not all) programs, e.g. jq can read input from file natively, but maybe it is more useful in a pipeline, e.g. from the output of curl.
cat file.txt |
and< file.txt
do the same exact thing. For this reason it would be beneficial to prefer using one over the other in the pages. The advantage of< file.txt
would be that we don't need to involve any other commands but it's less known than piping. Thus new users might not understand what it does. If we started using it commonly, the knowledge of what it does might spread.cat file.txt |
has the advantage that everyone has seen it being used.This should not be a hardline stance. Each command should be judged case by case based on how it's most commonly written on the internet, but when in doubt this guideline could be used.
The text was updated successfully, but these errors were encountered: