I have tried how to align text correctly
I can't get better than this
What can i do ?
The text file i am using :
- PK 744 - Hide Activities Button - User - Enabled -
PK 72 - Recent Items - User - Disabled -
PK 584 - TaskBar - User - Enabled -
PK 704 - All Windows - User - Disabled -
PK 15 - AlternateTab - System - Enabled - Favorite
PK 6 - Applications Menu - System - Disabled -
PK 16 - Auto Move Windows - System - Disabled -
PK 779 - Clipboard Indicator - User - Enabled - Favorite
PK 307 - Dash to Dock - User - Enabled - Favorite
PK 884 - Disper Menu - User - Disabled -
PK 7 - Removable Drive Menu - System - Disabled -
PK 442 - Drop Down Terminal - User - Enabled -
PK 885 - Dynamic Top Bar - User - Enabled - Favorite
PK 810 - Hide App Icon - User - Enabled -
PK 544 - HistoryManager Prefix Search - User - Enabled -
PK 600 - Launch new instance - System - Disabled -
PK 36 - Lock Keys - User - Enabled -
PK 898 - MMOD Panel - User - Disabled -
PK 18 - Native Window Placement - System - Disabled -
PK 750 - OpenWeather - System - Enabled - Favorite
PK 708 - Panel OSD - User - Enabled -
PK 8 - Places Status Indicator - System - Disabled -
PK 836 - Internet Radio - User - Disabled -
PK 881 - Screenshot Window Sizer - System - Disabled -
PK 9 - SystemMonitor - System - Disabled -
PK 1052 - Taskwarrior Integration - User - Disabled -
PK 570 - Todo.txt - User - Enabled - Favorite
PK 1166 - Extension Update Notifier - User - Enabled -
PK 19 - User Themes - System - Disabled -
PK 549 - Web Search Dialog - User - Enabled -
PK 602 - Window List - System - Disabled -
PK 10 - windowNavigator - System - Disabled - Favorite
PK 21 - Workspace Indicator - System - Disabled - Favorite
Code: Select all
#!/bin/bash
input="status.fav"
ni=0
while IFS= read -r var
do
var=`sed 's/ - /-/g' <<< $var`
IFS="-" read -a arr <<< $var
#echo ${#arr[@]}
IFS=" " read -a arr2 <<< ${arr[0]}
#stri=${arr[0]}
strpk1=${arr2[0]}
strpk2=${arr2[1]}
strname=${arr[1]}
stred=${arr[2]}
strusrsys=${arr[3]}
strfav=${arr[4]}
#echo $stri1 ; echo $stri2 ; echo $strj ; echo $strk ; echo $strl ; echo $strm ; echo "---"
line='..........................................................................................'
format="%-2s %4d %-80s %s %-10s %-10s %-10s\n"
printf "$format" "$strpk1" "$strpk2" "$strname ${line:${#strname}}" "$stred" "$strusrsys" "$strfav"
ni=$[ni+1]
nf=`grep Favorite status | wc -l`
ne=`grep Enabled status | wc -l`
nd=`grep Disabled status | wc -l`
nu=`grep User status | wc -l`
ns=`grep System status | wc -l`
done < "$input"
echo "(Extensions installed : $ni - Favorites : $nf - Enabled : $ne - Disabled : $nd - User : $nu - System : $ns)"