LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Valid characters in /sys/class/rfkill/rfkill[0-9]+/name (https://www.linuxquestions.org/questions/linux-kernel-70/valid-characters-in-sys-class-rfkill-rfkill%5B0-9%5D-name-4175548857/)

l0p3n 07-24-2015 02:24 PM

Valid characters in /sys/class/rfkill/rfkill[0-9]+/name
 
I'm trying to write a regular expression to match an rfkill device name. The device name could for example be phy0 and can normally be found in /sys/class/rfkill/rfkill[0-9]+/name.

In order to write this regular expression I need to know the possible characters in an rfkill device name found in /sys/class/rfkill/rfkill[0-9]+/name. kernel.org tells us that the name is an arbitrary string (https://www.kernel.org/doc/Documenta...s-class-rfkill). Is it then wrong to assume that this string could be made up of any character (for example even :^❤ ☀ ☆ ☂ ☻ ♞ ☯ ☭ ☢ €)?

Thanks in advance!

schneidz 07-25-2015 09:30 AM

Quote:

Originally Posted by l0p3n (Post 5395878)
I'm trying to write a regular expression to match an rfkill device name. The device name could for example be phy0 and can normally be found in /sys/class/rfkill/rfkill[0-9]+/name.

this worx on my system:
Code:

[liveuser@localhost lq-iso]$ ll  /sys/class/rfkill/rfkill[0-9]*/name
-r--r--r--. 1 root root 4096 Jul 25 10:26 /sys/class/rfkill/rfkill0/name

Quote:

Originally Posted by l0p3n (Post 5395878)
In order to write this regular expression I need to know the possible characters in an rfkill device name found in /sys/class/rfkill/rfkill[0-9]+/name. kernel.org tells us that the name is an arbitrary string (https://www.kernel.org/doc/Documenta...s-class-rfkill). Is it then wrong to assume that this string could be made up of any character (for example even :^❤ ☀ ☆ ☂ ☻ ♞ ☯ ☭ ☢ €)?

Thanks in advance!

not sure but unlikely a human would write something unintelligible unless they are purposely trying to obfuscate something.


All times are GMT -5. The time now is 05:09 AM.