What does -gt operator mean in Bash programming

0 votes

I was reading some code, but I could not understand one thing.

What does -gt mean in the following code?

if [ $result -gt 0 ] ;
then
    exit 1 ;
fi
Jun 20, 2022 in Linux Administration by Korak
• 5,820 points
1,003 views

1 answer to this question.

0 votes

It's a math test. assist with testing tells:

  arg1 OP arg2 Arithmetic tests. Over powered is one of - eq, - ne,
                 -lt, - le, - gt, or - ge.
-gt is more noteworthy than.

In your model, the condition is valid assuming the variable outcome is more prominent than nothing.

answered Jun 20, 2022 by Rahul
• 3,380 points

Related Questions In Linux Administration

0 votes
1 answer

What does -f mean in bash

Luckily, the Bash Reference Manual is accessible ...READ MORE

answered Jun 10, 2022 in Linux Administration by Korak
• 5,820 points
700 views
0 votes
0 answers

What does the $ mean in Linux?

I have to explain what the code ...READ MORE

Apr 13, 2022 in Linux Administration by Soham
• 9,710 points
740 views
0 votes
0 answers

What does the $ mean in Linux?

I have to explain what the code ...READ MORE

Dec 14, 2022 in Linux Administration by erzan
• 630 points
699 views
+2 votes
2 answers

What does file permission 755 mean?

Hi, File permission 755 means that the directory ...READ MORE

answered Dec 9, 2020 in Linux Administration by MD
• 95,460 points
269,661 views
0 votes
0 answers

What exactly does the Unix `bash` command do when run without options?

When you type bash into the terminal ...READ MORE

Apr 14, 2022 in Linux Administration by Soham
• 9,710 points
409 views
0 votes
0 answers

What does "&" at the end of a linux command mean?

I am a system administrator and I ...READ MORE

Apr 21, 2022 in Linux Administration by Edureka
• 13,690 points
560 views
0 votes
1 answer

What does “sudo echo nameserver 8.8.8.8 > /etc/resolv.conf” do?

If executing this command resolved your issue ...READ MORE

answered Jan 23, 2019 in Linux Administration by joey
3,165 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,220 points
1,117 views
0 votes
1 answer

Why do you need to put #!/bin/bash at the beginning of a script file?

It's a show so the *nix shell ...READ MORE

answered Jun 20, 2022 in Linux Administration by Rahul
• 3,380 points
1,112 views
0 votes
1 answer

bash : Bad Substitution

The default shell (/bin/sh) under Ubuntu focuses ...READ MORE

answered Jun 20, 2022 in Linux Administration by Rahul
• 3,380 points
1,956 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP