Hi All,
I am trying to print the dpkg -l command output each field using below script. But i am unable to print the entire data of the last column.
Can someone please help me in selecting the entire last column data.
Below is the Command output :
||/ Name Version Architecture Description
+++-================================-=====================-=====================-=====================================================================
ii accountsservice 0.6.45-1ubuntu1 amd64 query and manipulate user account information
ii acl 2.2.52-3build1 amd64 Access control list utilities
ii acpid 1:2.0.28-1ubuntu1 amd64 Advanced Configuration and Power Interface event daemon
ii adduser 3.116ubuntu1 all add and remove users and groups
ii amd64-microcode 3.20191021.1+really3. amd64 Processor microcode firmware for AMD CPUs
ii apparmor 2.12-4ubuntu5.1 amd64 user-space parser utility for AppArmor
ii apport 2.20.9-0ubuntu7.9 all automatically generate crash reports for debugging
ii apport-symptoms 0.20 all symptom scripts for apport
Below is my script :
while IFS= read -r line;
do
NAME=$(echo "$line"|awk '{print $2}')
Description=$(echo "$line"|awk '{print $5}')
echo -e "{\"'name'\":\"'"$name"'\",\"'Description'\":\"'"$Description"'\"
}"
done < filename
I am unable to print the entire data of description column.
Can someone please help me in getting the entire data ?