-4
$cat shebang.sed 
#! /bin/sed -f
s/red/xxx/
s/BLUE/1234/

$./shebang.sed rgb
lower (#1): "xxx green blue"
UPPER (#2): "RED GREEN 1234"

$sed -f shebang.sed rgb
lower (#1): "xxx green blue"
UPPER (#2): "RED GREEN 1234"

I may guess what #! is doing. However, I don't say I know it. what is "#!"?

muru
  • 197,895
  • 55
  • 485
  • 740
Smile
  • 1,099

1 Answers1

2

This line is called shebang and is used to tell the terminal which interpreter to use when executing the script. In your case, you use sed

Other examples would be:

#!/bin/bash            # -> uses bash
#!/usr/bin/perl        # -> uses perl
#!/usr/bin/env python  # -> uses python
Wayne_Yux
  • 4,873