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,026 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
727 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
774 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
749 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
271,686 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
430 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
582 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,194 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,137 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,152 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,985 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