Skip to main content
Commonmark migration
Source Link

Bash 66 62 21 bytes##bytes

ping -c1 g.gl echo $? 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

Bash 66 62 21 bytes##

ping -c1 g.gl echo $? 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

Bash 66 62 21 bytes

ping -c1 g.gl echo $? 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

changed code, changed byte count
Source Link
Abel Tom
  • 1.2k
  • 1
  • 7
  • 10

Bash 66 6262 21 bytes##

r=$(ping -c1 g.gl)if [echo $? -ne "0" ];then echo"0"else echo"1"fi 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

Bash 66 62 bytes##

r=$(ping -c1 g.gl)if [ $? -ne "0" ];then echo"0"else echo"1"fi 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

Bash 66 62 21 bytes##

ping -c1 g.gl echo $? 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

changed code
Source Link
Abel Tom
  • 1.2k
  • 1
  • 7
  • 10

Bash 6666 62 bytes##

r=$(ping -c1 googleg.comgl)if [ $? -ne 0"0" ]then];then echo"0"else echo"1"fi 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 googleg.comgl) if [ $? -ne 0 ]]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

Bash 66 bytes##

r=$(ping -c1 google.com)if [ $? -ne 0 ]then echo"0"else echo"1"fi 

Ungolfed version:

r=$(ping -c1 google.com) if [ $? -ne 0 ] then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

Bash 66 62 bytes##

r=$(ping -c1 g.gl)if [ $? -ne "0" ];then echo"0"else echo"1"fi 

Thanks @Alex L. for the URL shortening tip.

Ungolfed version:

r=$(ping -c1 g.gl) if [ $? -ne 0 ]; then echo "0" else echo "1" fi 

This is my first answer in Bash , i'm not sure i have shortened the script enough.

deleted 2 characters in body
Source Link
Abel Tom
  • 1.2k
  • 1
  • 7
  • 10
Loading
Source Link
Abel Tom
  • 1.2k
  • 1
  • 7
  • 10
Loading