0

I am trying to run the following bash program with sed and I am seeing an sed: -e expression #1, char 44: Invalid range end . I tried adding the -r option but still seeing the error.

#!/bin/bash


TEST="--extra-vars user=jsmith a=abcd --test"

echo $TEST | sed -re "s/(--extra-vars )([a-zA-z0-9\=\s]*)\b/\1\2/g"
Community
  • 1
  • 1
Zee
  • 1,321
  • 2
  • 18
  • 41

1 Answers1

4

You're getting an Invalid range end error because you've wrote A-z inside your character class, which is a negative range (z < A).

Aaron
  • 24,009
  • 2
  • 33
  • 57