Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Thanks for the rewrite, but I get the following errors. When the script first executes: sed: -e expression #1, char 17: unterminated `s' command After the script has fully executed and has exited, the following error appears: /bin/sed: -e expression #1, char 0: no previous regular expression Commented Mar 3, 2021 at 4:46
  • Rather than trying to do everything on the remote host, just cat the remote file and work on it locally (or scp it over here). Then transfer it back. This makes quoting easier. Commented Mar 3, 2021 at 7:48
  • @jackcsprat can you place an echo before thevssh command and share the output. Also copy paste from my code only as I made extensive rewrite. Commented Mar 3, 2021 at 9:26
  • @guest_7 At exit of script: check_mem_ng.sh 100% 6294 6.2KB/s 00:00 ssh -o StrictHostKeyChecking no myserver sudo /usr/localcw/bin/eksh -c '/bin/cp /tmp/check_mem_ng.sh /opt/tools/nagitem/libexec/;chown nagitem:nagitem /opt/tools/nagitem/libexec//check_mem_ng.sh;cd /opt/tools/nagitem/nrdp/clients/nrds/; /bin/sed -i -e '\''s//command[[]Check_Memory_OS_10038[]]=\/opt\/tools\/nagitem\/libexec\/check_mem_ng.sh -w 80 -c 90/g'\'' /opt/tools/nagitem/nrdp/clients/nrds/nrds.cfg ' Commented Mar 3, 2021 at 15:43
  • Thanks for sharing the data. It enabled me to get to the issue. Now copy again and give it a spin. It will fly now. Commented Mar 3, 2021 at 17:10