Sample Header Ad - 728x90

How to suppress php output in one-line chained terminal command

1 vote
0 answers
369 views
I use the following &&-chained one-line command in Linux terminal (Ubuntu desktop): cd /opt/lampp/htdocs/detailed_payouts && for FILE in *; do dos2unix $FILE; done && php /opt/lampp/htdocs/mydeal-join-columns-2.php && cd /opt/lampp/htdocs/xero-bills && csvstack * > xero-bills-csvstacked.csv && cd /opt/lampp/htdocs/xero-invoices && csvstack * > xero-inv-csvstacked.csv However, I don't actually want to see the messy output of php in terminal. I've tried various approaches, such as
php filename.php >/dev/null 2>&1 &
As given in this Q&A: https://stackoverflow.com/a/6989340/9095603 However, it totally breaks the one-liner and causes the command to exit prematurely. I am not invested in the above approach at all - I just need any simple approach which will allow me to run the one-liner and suppress the terminal output of the php execution.
Asked by mercurio (11 rep)
Oct 1, 2022, 12:09 PM