« first day (195 days earlier)
← previous day
last day (14 days later) »
chaos
08:25
hi^^
Avinash Raj
hi
i get your point.
working to short out your code.
@chaos
alex
@Raj would you please put your answer. I need both of your codes thanks for help
Avinash Raj
working on that. No, if i found any i'll merge it with chaos.
alex
ok any way thanks
chaos
Try this, it is a bit more dynamic without variables
`cat /home/$(whoami)/.mozilla/firefox/$(awk -F"Path=" '/^Path/{print $2}' /home/$(whoami)/.mozilla/firefox/profiles.ini)/addons.json | python -c 'import json,sys;obj=json.load(sys.stdin);
for (i, x) in enumerate(obj["addons"]):
print x["name"]'`
without quotes sry:
cat /home/$(whoami)/.mozilla/firefox/$(awk -F"Path=" '/^Path/{print $2}' /home/$(whoami)/.mozilla/firefox/profiles.ini)/addons.json | python -c 'import json,sys;obj=json.load(sys.stdin);
for (i, x) in enumerate(obj["addons"]):
print x["name"]'
Avinash Raj
08:39
useless use of cat
@chaos
chaos
sry it's better with pastebin:
pastebin.com/AzUMqw2v
Avinash Raj
use fixed font.
option.
chaos
take the RAW Paste Data
@AvinashRaj why useless? phyton reads from stdin
fixed font?
Avinash Raj
@chaos got a oneliner command.
@alex ^^
wanna know?
why no reply?
are you there?
without using python.
chaos
am here
Avinash Raj
08:48
how about this?
grep -oP '(?<=\},\"name\":\")([^"]*)' ~/.mozilla/firefox/$(grep -oP 'Path=\K.*' /home/$USER/.mozilla/firefox/profiles.ini)/addons.json
going to edit your answer.
chaos
wait
keep the python answer too
because python parses json
your answer greps json
if something changes your answer might not work anymore
Avinash Raj
there is no chance of a change.
just try on your system.
let me know whether it works or not?
@alex you also ^^^
chaos
it worked, but mozilla can change the part
json should be read with a json parser, as xml should be read with a xml parser...
Avinash Raj
yep, i know.
chaos
but its ok, its also a good answer, thanks
Avinash Raj
08:52
first give a try to that one liner. If it fails then go for the python option.
chaos
yep
and maybe change the $USER to $(whoami)
not every shell has the $USER variable set
Avinash Raj
someone will surely argue "How dare you parse a json file with grep?"
lol:-)
chaos
as usually^^ =)
Avinash Raj
@chaos it's your's.
chaos
thats why i wrote it with a json parser =)
Avinash Raj
08:53
and +1 from me.
let's remove the comments.
chaos
changed, thanks
Avinash Raj
Gotta go. Bye :-)
chaos
bye
« first day (195 days earlier)
← previous day
last day (14 days later) »
all rooms
Transcript for
Jun
19
Jun '14
20
Jul
4
Room for Avinash Raj and whoever want
…
apt
boot-repair
command-line
dpkg
software-installation
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2025 Stack Exchange Inc;
legal
mobile