I have a shell script here that works online, but do not work locally on terminal. What could be the possible reason? How should I debug?
#!/bin/bash
string='internal func add() -> Int'
sed -e '
s/^.*func \+//
s/ *\->.*$//
s/:[^,)]\+/:/g
s/[, ]//g
' <<< "$string"
echo $SHELL
For the input that is present in the shell script, I get internalfuncadd()
on local computer, instead of add()
- which is the correct output that I get online.