Closed GarlandKey closed 6 years ago
For test can you give an example of syntax (or line) that don't work ?
For test I make a little conky with that line : ${exec cat /home/dominique/.conkyrc/test.txt | grep [[:alpha:]]}
and that don't work, I think because [[...]] is a setting in conky 1.10
But with this line : ${exec cat /home/dominique/.conkyrc/test.txt | grep [[:alpha:]]}
That work , I just escape the double bracket with double \ : [[...]]
Thanks, @chepioq - I'll give your solution a go. Will report back.
The line that I want to use is ${exec nvidia-smi -q -g 0 2>&1 | grep -A 2 -i '^[[:space:]]}\{4\}Clocks$' | grep -i Graphics | tail -1 | awk '{printf "% 5d%s", $3, $4}'}
I think the above solution from @chepioq may have worked. I've got a new error from the line that I need to resolve before I can be sure.
The new error that I'm receiving is sh: -c: line 0: unexpected EOF while looking for matching
''
sh: -c: line 1: syntax error: unexpected end of file`
The line that I'm using is: ${exec nvidia-smi -q -g 0 2>&1 | grep -A 2 -i '^\[\[:space:\]\]}\{4\}Clocks$' | grep -i Graphics | tail -1 | awk '{printf "% 5d%s", $3, $4}'}
It's breaking here \[\[:space:\]\]}
Try this : ${exec nvidia-smi -q -g 0 2>&1 | grep -A 2 -i '^[[:space:]]{4}Clocks$' | grep -i Graphics | tail -1 | awk '{printf "% 5d%s", $3, $4}'} You have a } after the last bracket ] ,which is useless.
Just one question: What do you want to see ? If you want the current frequency clock, you can use nvidia-settings instead of nvidia-smi e.g. : nvidia-settings -q GPUCurrentClockFreqs -t
Return on my laptop: [dominique@host-192-168-1-2 ~]$ nvidia-settings -q GPUCurrentClockFreqs -t 475,896 [dominique@host-192-168-1-2 ~]$ Or [dominique@host-192-168-1-2 ~]$ nvidia-settings -q GPUCurrentClockFreqsString -t nvclock=475, nvclockmin=475, nvclockmax=475, nvclockeditable=0, memclock=896, memclockmin=900, memclockmax=900, memclockeditable=0, memTransferRate=1792, memTransferRatemin=1800, memTransferRatemax=1800, memTransferRateeditable=0, processorclock=950, processorclockmin=950, processorclockmax=950, processorclockeditable=0 [dominique@host-192-168-1-2 ~]$
@chepioq That's correct - I was trying to pull the clock frequency. Thanks for sharing this solution - it's much easier to implement and read.
Issue solved by a kind and helpful person. Many thanks.
Synopsis Users are no longer able to use grep character classes or bracket expressions ( e.g.
[[:space:]]
) using the new syntax.Error Message
Syntax error (~/.conkyrc:147: nesting of [[...]] is deprecated near '[') while reading config file.
References
man grep
https://www.gnu.org/software/grep/manual/grep.html