0

Running the following line in my script gives me a Permission denied error:

$config_out | sed -e 's#name="in" value=""#name="in" value="1600"#' > $config_out".tmp"

Before I had $config_out | sed -e 's#name="in" value=""#name="in" value="1600"#' > $config_out,so without the .tmp at the end. I read somewhere that you get the error when trying to pipe the output to the same file that you are reading it from. But when I'm writing it to another file, I don't know why I get that error.

Niek de Klein
  • 8,524
  • 20
  • 72
  • 143

1 Answers1

1

Is $config_out the name of a file or a command? If it's a file, then you need to either cat $config_out | sed ... or sed ... < $config_out > $config_out.tmp. If it's a command, though, the first command might have truncated/overwritten whatever it was (shell script or perl script or something?).

twalberg
  • 59,951
  • 11
  • 89
  • 84