You are not logged in.
Pages: 1
Hi, I'm trying to make a script to show in torsmo:
- Amount of Packages on my system
- My CPU Model
- Amount of modules loaded
And I got it work correctly, but there's one little detail, I need to delete some spaces when I am editing the result of ...for example /proc/cpuinfo , how can I do that?, something related to sed?
Thanxs
Arch GNU/Linux 0.7.1 (Noodle)
Linux 2.6.14-archck1
Offline
seems I've been doing alot of regex explainations today... (someone at work asked me "hey what's this 'pattern' variable for".... sigh... do they even interview these monkeys?)
as for using sed, you want to do it like this:
sed "s/<anything before>(<pattern to match>)<anything after>/1/g"
that will replace any line with whatever was in the "(" and ")" grouping....
so... lets say we have a line like:
" I have spaces before and after "
if we pipe this line to sed, we can do:
sed "s/s*(.*)s*/1/g"
wow, that looks complicated 8)
you can also use "tr" to remove characters from the output....
how about this: post your output and what you want it to look like, and I'll give you a sed expression to make it work 8)
Offline
${execi 5 cat /proc/cpuinfo | grep "model name" | sed s/'model name.*:'//}
Offline
Thanks, phrakture ...
sed "s/s*(.*)s*/1/g"
it works fine ,
Also thanks for your post tbroderick
Arch GNU/Linux 0.7.1 (Noodle)
Linux 2.6.14-archck1
Offline
Pages: 1