iopipe/lambda-shell

command fail with sed error on Mac OS X

Opened this issue · 1 comments

$ uname -a
Darwin 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64

$ cat ./lambda-shell

!/bin/bash

while : ; do
read -p '$ ' cmd
apex invoke exec <<<"{ "command": "$cmd" }" | sed 's/\n/\n/g; s/\t/\t/g; 1{ s/^"// }; ${ s/"$//; };'
done

$ ./lambda-shell

$ ls
sed: 1: "s/\n/\n/g; s/\t/\t/g; ...": bad flag in substitute command: '}'

@sebsto i had that problem too and ended up fiddling with it until I got it to work:

#2

Not sure it's the right way to do it, but seems to work for me.