MYPATH=/var/www/html/error_logs/
TOTALFILE=$(ls $MYPATH* | wc -l)
FILETIME=$(stat --format=%y $MYPATH* | head -5 | cut -d'.' -f1)
FILE=$(ls -1tcr $MYPATH* | head -5 | rev | cut -d/ -f1 | rev)
TOPLINE=$(head -1 $MYPATH* | grep -Po '".*?"' | head -5)
मैं हेडर के साथ कॉलम में 5 फाइलों की जानकारी को कैसे सुरुचिपूर्ण ढंग से प्रिंट कर सकता हूं?
FILE CREATED TIME | FILE NAME | ERROR HEADER
---------------------------------------------
$FILETIME | $FILE | $TOPLINE
2012-11-29 11:27:45 | 684939947465 | "SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
और 5 फ़ाइलों पर
total files: $TOTALFILE
क्या कोई आसान तरीका है जो मुझे चाहिए?
नोट: यह आउटपुट मुझे तब मिला जब हर वेरिएबल को इको किया
2012-11-29 11:27:45 2012-11-29 11:27:41 2012-11-28 23:33:01 2012-11-26 10:23:37 2012-11-19 22:49:36
684939947465 1313307654813 1311411049509 1234980770182 354797376843
"SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)" "SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)" "Connection to localhost:6379 failed: Connection refused (111)" "An error occurred connecting to Redis." "SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"