Bash to send command to Arduino

Your arduino code does not check if there is a character on the serial port, check - Serial.available() - Arduino Reference

#DEFINE LEDPIN 13   
 
char val;

void setup()
{
  Serial.begin(9600);
  pinMode(LEDPIN , OUTPUT);
}

void loop ()
{
  if (Serial.available() > 0) 
  {
    val = Serial.read();
    if (val == '0')
    {
      digitalWrite(LEDPIN ,LOW);
    }
    if (val == '1') 
    {
      digitalWrite(LEDPIN ,HIGH);
    }
  }
}