2>&1 & redirecting errors
Në shqip: Ridrejtimi i gabimeve (2>&1)
ShpjegimiSQ
Gabimet shkojnë në kanalin 2 (stderr), jo te dalja normale (1). „2> gabime.txt“ i ruan veçmas, ndërsa „> out.txt 2>&1“ i bashkon të dyja në një skedar. Rendi ka rëndësi!
EnglishEN
Errors go to channel 2 (stderr), not normal output (1). “2> errors.txt” saves them separately, while “> out.txt 2>&1” merges both into one file. Order matters!
Si ta mendosh
Si dy kuti postare: një për letrat normale, një për ankesat — dhe mund t'i bashkosh.
Lexoje në anglisht
Like two mailboxes: one for normal letters, one for complaints — and you can merge them.
Shembull kodibash
npm run build > build.log 2>&1
python app.py 2> gabime.txt
cmd &> te-gjitha.txt # shkurtim në Bash