-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
  • 193,181
  • 53
  • 473
  • 722
Smile
  • 1,089
  • 3
  • 19
  • 31

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
  • 3
  • 27
  • 35