Hi there,
I'm currently a student at my local university doing an IT degree (just started the final year of my coursework), and I have elected to do some UNIX subjects just so I can better understand my future role etc. I think I have a general grasp of the CLI although I'm still a beginner, and I have a task to capture the 'flag' settings of my cpu information and output them sequentially line by line in an alphabetical list (number first like 3dprefetchnow). What's more; I have to do this in a single command, so I can't use ; to separate them. This is a problem that I've been trying to tackle off and on for about 3 days now, and I can't seem to make much more headway than I have. Navigating to the /proc directory I type:
cat cpuinfo | grep "flags" | cut -d ":" -f 2 | <<<????>>>
This shows the list of flags set by the cpu (interestingly enough; I think it actually has a preceding whitespace character in the output, but I'm not sure if this is something I should be completely concerned with) but I can't use sort as my next command because from all the examples I've seen of it; sort works on a line by line basis, not by words in a single line.
My question is, what next? I had seq suggested (with the global flag) but honestly I'm not quite sure how that would work given that it's a find and replace method right? How would that do a recursive alphabet lookup?
I'm currently a student at my local university doing an IT degree (just started the final year of my coursework), and I have elected to do some UNIX subjects just so I can better understand my future role etc. I think I have a general grasp of the CLI although I'm still a beginner, and I have a task to capture the 'flag' settings of my cpu information and output them sequentially line by line in an alphabetical list (number first like 3dprefetchnow). What's more; I have to do this in a single command, so I can't use ; to separate them. This is a problem that I've been trying to tackle off and on for about 3 days now, and I can't seem to make much more headway than I have. Navigating to the /proc directory I type:
cat cpuinfo | grep "flags" | cut -d ":" -f 2 | <<<????>>>
This shows the list of flags set by the cpu (interestingly enough; I think it actually has a preceding whitespace character in the output, but I'm not sure if this is something I should be completely concerned with) but I can't use sort as my next command because from all the examples I've seen of it; sort works on a line by line basis, not by words in a single line.
My question is, what next? I had seq suggested (with the global flag) but honestly I'm not quite sure how that would work given that it's a find and replace method right? How would that do a recursive alphabet lookup?