What is uname-r | grep fc?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
I was reading a .sh file and find a line written as
if[ "`uname -r | grep fc`" == " " ]; then
But I don't find the meaning of fc
and the whole expression.
I am using Ubuntu 16.04 LTS.
Thanks in Advance.
grep
add a comment |Â
up vote
0
down vote
favorite
I was reading a .sh file and find a line written as
if[ "`uname -r | grep fc`" == " " ]; then
But I don't find the meaning of fc
and the whole expression.
I am using Ubuntu 16.04 LTS.
Thanks in Advance.
grep
Are the typos in that line made by you or are they from the script?
â muru
Jun 2 at 5:45
2
The command in the question can never evaluate totrue
. Eitheruname -r
contains the lettersfc
, in which casegrep
outputs that line. It is guaranteed to not equal a simple space character (as it has to contain at least the caracters "fc"). If, on the other hand,uname -r
doesn't contain "fc",grep
will output nothing which also is not equal to a single space. So both possible cases arefalse
. That being said, can you please double check that you pasted the line exactly as written in the script, including all special characters and all spaces?
â Lienhart Woitok
Jun 2 at 7:26
1
Example :uname -r | grep fc
â 4.16.12-300. fc28 .x86_64. ... I.e. checking if the kernel is Fedora. Seems to be from a driver install script ubuntuforums.org/archive/index.php/t-2282796.html : "Realtek Wi-Fi driver Auto installationscript", "November, 21 2011 v1.1.0"
â Knud Larsen
Jun 2 at 8:09
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I was reading a .sh file and find a line written as
if[ "`uname -r | grep fc`" == " " ]; then
But I don't find the meaning of fc
and the whole expression.
I am using Ubuntu 16.04 LTS.
Thanks in Advance.
grep
I was reading a .sh file and find a line written as
if[ "`uname -r | grep fc`" == " " ]; then
But I don't find the meaning of fc
and the whole expression.
I am using Ubuntu 16.04 LTS.
Thanks in Advance.
grep
asked Jun 2 at 4:24
![](https://i.stack.imgur.com/mKdVu.jpg?s=32&g=1)
![](https://i.stack.imgur.com/mKdVu.jpg?s=32&g=1)
Sanmveg saini
1042
1042
Are the typos in that line made by you or are they from the script?
â muru
Jun 2 at 5:45
2
The command in the question can never evaluate totrue
. Eitheruname -r
contains the lettersfc
, in which casegrep
outputs that line. It is guaranteed to not equal a simple space character (as it has to contain at least the caracters "fc"). If, on the other hand,uname -r
doesn't contain "fc",grep
will output nothing which also is not equal to a single space. So both possible cases arefalse
. That being said, can you please double check that you pasted the line exactly as written in the script, including all special characters and all spaces?
â Lienhart Woitok
Jun 2 at 7:26
1
Example :uname -r | grep fc
â 4.16.12-300. fc28 .x86_64. ... I.e. checking if the kernel is Fedora. Seems to be from a driver install script ubuntuforums.org/archive/index.php/t-2282796.html : "Realtek Wi-Fi driver Auto installationscript", "November, 21 2011 v1.1.0"
â Knud Larsen
Jun 2 at 8:09
add a comment |Â
Are the typos in that line made by you or are they from the script?
â muru
Jun 2 at 5:45
2
The command in the question can never evaluate totrue
. Eitheruname -r
contains the lettersfc
, in which casegrep
outputs that line. It is guaranteed to not equal a simple space character (as it has to contain at least the caracters "fc"). If, on the other hand,uname -r
doesn't contain "fc",grep
will output nothing which also is not equal to a single space. So both possible cases arefalse
. That being said, can you please double check that you pasted the line exactly as written in the script, including all special characters and all spaces?
â Lienhart Woitok
Jun 2 at 7:26
1
Example :uname -r | grep fc
â 4.16.12-300. fc28 .x86_64. ... I.e. checking if the kernel is Fedora. Seems to be from a driver install script ubuntuforums.org/archive/index.php/t-2282796.html : "Realtek Wi-Fi driver Auto installationscript", "November, 21 2011 v1.1.0"
â Knud Larsen
Jun 2 at 8:09
Are the typos in that line made by you or are they from the script?
â muru
Jun 2 at 5:45
Are the typos in that line made by you or are they from the script?
â muru
Jun 2 at 5:45
2
2
The command in the question can never evaluate to
true
. Either uname -r
contains the letters fc
, in which case grep
outputs that line. It is guaranteed to not equal a simple space character (as it has to contain at least the caracters "fc"). If, on the other hand, uname -r
doesn't contain "fc", grep
will output nothing which also is not equal to a single space. So both possible cases are false
. That being said, can you please double check that you pasted the line exactly as written in the script, including all special characters and all spaces?â Lienhart Woitok
Jun 2 at 7:26
The command in the question can never evaluate to
true
. Either uname -r
contains the letters fc
, in which case grep
outputs that line. It is guaranteed to not equal a simple space character (as it has to contain at least the caracters "fc"). If, on the other hand, uname -r
doesn't contain "fc", grep
will output nothing which also is not equal to a single space. So both possible cases are false
. That being said, can you please double check that you pasted the line exactly as written in the script, including all special characters and all spaces?â Lienhart Woitok
Jun 2 at 7:26
1
1
Example :
uname -r | grep fc
â 4.16.12-300. fc28 .x86_64. ... I.e. checking if the kernel is Fedora. Seems to be from a driver install script ubuntuforums.org/archive/index.php/t-2282796.html : "Realtek Wi-Fi driver Auto installationscript", "November, 21 2011 v1.1.0"â Knud Larsen
Jun 2 at 8:09
Example :
uname -r | grep fc
â 4.16.12-300. fc28 .x86_64. ... I.e. checking if the kernel is Fedora. Seems to be from a driver install script ubuntuforums.org/archive/index.php/t-2282796.html : "Realtek Wi-Fi driver Auto installationscript", "November, 21 2011 v1.1.0"â Knud Larsen
Jun 2 at 8:09
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
the special back tick char will return whatever is evaluated inside of the backticks. so uname -r | grep fc
will return something only if your kernel release contains the letters fc. If no fc then it will just be the newline character. So the if statement will only evaluate to true when fc is not contained in your kernel string that is returned from uname. try doing
export a=`uname -r`
echo $a
as a test
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
the special back tick char will return whatever is evaluated inside of the backticks. so uname -r | grep fc
will return something only if your kernel release contains the letters fc. If no fc then it will just be the newline character. So the if statement will only evaluate to true when fc is not contained in your kernel string that is returned from uname. try doing
export a=`uname -r`
echo $a
as a test
add a comment |Â
up vote
1
down vote
the special back tick char will return whatever is evaluated inside of the backticks. so uname -r | grep fc
will return something only if your kernel release contains the letters fc. If no fc then it will just be the newline character. So the if statement will only evaluate to true when fc is not contained in your kernel string that is returned from uname. try doing
export a=`uname -r`
echo $a
as a test
add a comment |Â
up vote
1
down vote
up vote
1
down vote
the special back tick char will return whatever is evaluated inside of the backticks. so uname -r | grep fc
will return something only if your kernel release contains the letters fc. If no fc then it will just be the newline character. So the if statement will only evaluate to true when fc is not contained in your kernel string that is returned from uname. try doing
export a=`uname -r`
echo $a
as a test
the special back tick char will return whatever is evaluated inside of the backticks. so uname -r | grep fc
will return something only if your kernel release contains the letters fc. If no fc then it will just be the newline character. So the if statement will only evaluate to true when fc is not contained in your kernel string that is returned from uname. try doing
export a=`uname -r`
echo $a
as a test
answered Jun 2 at 5:17
![](https://lh3.googleusercontent.com/-n42ndDbjNTY/AAAAAAAAAAI/AAAAAAAAkMk/n-bc47CkE7Y/photo.jpg?sz=32)
![](https://lh3.googleusercontent.com/-n42ndDbjNTY/AAAAAAAAAAI/AAAAAAAAkMk/n-bc47CkE7Y/photo.jpg?sz=32)
oldITdude
111
111
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1042818%2fwhat-is-uname-r-grep-fc%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Are the typos in that line made by you or are they from the script?
â muru
Jun 2 at 5:45
2
The command in the question can never evaluate to
true
. Eitheruname -r
contains the lettersfc
, in which casegrep
outputs that line. It is guaranteed to not equal a simple space character (as it has to contain at least the caracters "fc"). If, on the other hand,uname -r
doesn't contain "fc",grep
will output nothing which also is not equal to a single space. So both possible cases arefalse
. That being said, can you please double check that you pasted the line exactly as written in the script, including all special characters and all spaces?â Lienhart Woitok
Jun 2 at 7:26
1
Example :
uname -r | grep fc
â 4.16.12-300. fc28 .x86_64. ... I.e. checking if the kernel is Fedora. Seems to be from a driver install script ubuntuforums.org/archive/index.php/t-2282796.html : "Realtek Wi-Fi driver Auto installationscript", "November, 21 2011 v1.1.0"â Knud Larsen
Jun 2 at 8:09