0

I'm trying to run this command:

$ while :; do clear; curl $(head -5 fullCommands2.txt); sed -i '' -e 1,5d < fullCommands2.txt; sleep 400; done

Upon execution I'm given the error "sed: -i may not be used with stdin". I've looked several other solutions such as the ones presented here sed: -i may not be used with stdin on Mac OS X. However I keep getting the same error no matter how I change it.

How can I get this to run?

shellter
  • 36,525
  • 7
  • 83
  • 90
  • I won't try to reproduce that, but try leaving the open bracket ('<') out. – Beta Aug 08 '19 at 01:00
  • 1
    learn to read the error messages. All you should need to do is remove the redirection for std-in, i.e. the `<` char ;-) . Good luck. – shellter Aug 08 '19 at 01:26
  • I use `macOS` aswell and using `-i` alone never works for me. You need to specify a new extension. Like `sed -i'.extension' …`. This would save the results to both original file and create a new file with your current file plus that extension. I am not sure if its a bug or a desired behaviour. (can't be sure, I use a really old bash version) – Mihir Luthra Aug 08 '19 at 01:28
  • @Mihir, I had tried that as well, however I got the same error. It seems that the "<" was causing the error. – TheBluegrassMathematician Aug 08 '19 at 01:33

0 Answers0