I have a machine that I use to pass program updates between three people.
I am trying to get a notification when someone is using scp to get the latest version.
I keep getting unmatched quote errors.
So far, I am simply trying to get one rsh line sent, which works fine, but now I am trying to get a notification.
IP address & port number has been sanitized. Variable 'out' contains "randy - name of program and revision"
#!/usr/bin/rexxaddresssystem"rsh larry@123.456.789.10 -p4546 'ps aux | grep randy | grep scp'"withoutputstemrandy.out=word(randy.1,1)||" - "||substr(randy.1,84)sayoutsendstring='addresssystem"DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u larry)/bus /usr/bin/notify-send -t 0 """||out||"'"saysendstringinterpretsendstring
Here's what I want the sendstring to say:
Last edit: Larry 2023-12-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can see a mismatch of quotes in the sendstring = line, the first single quote is not being matched with the last as that's in double quotes. The number of double quotes around the notify-send payload will then not match, so will need fixing.
I'm not sure why the interpret statement is needed here, it's very powerful when needed, but also totally opaque, so a comment explaining what it's expected to look like when run is essential. Usually when writing the comment the way to avoid interpret jumps out in better logic.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I edited my post to add "Here's what I want the sendstring to say:" but then I neglected to add the example.
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u larry)/bus /usr/bin/notify-send -t 0 "randy - Test 3.14"
I think my problem is that I don't know enough about 'address system' .
I have 'The Regina Rexx Interpreter Version 3.3', and the examples all seem to say that I need to quote the entire string.
However, I did just figure out that I can use a variable to hold the string, which would not require an 'interpret'.
So I did figure it out, but not until I read your response, which gave me a few clues.
Thanks very much.
Here's how I did it. I have a lot more to go into it, but the rest should be easy.
#!/usr/bin/rexxaddresssystem"rsh larry@123.456.789.10 -p4242 'ps aux | grep randy | grep scp'"withoutputstemrandy.out='"'||word(randy.1,1)||" - "||substr(randy.1,84)||'"'sendstring='DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id-ularry)/bus/usr/bin/notify-send-t0'sendstring=sendstring||outsaysendstringaddresssystemsendstring
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a machine that I use to pass program updates between three people.
I am trying to get a notification when someone is using scp to get the latest version.
I keep getting unmatched quote errors.
So far, I am simply trying to get one rsh line sent, which works fine, but now I am trying to get a notification.
IP address & port number has been sanitized. Variable 'out' contains "randy - name of program and revision"
Here's what I want the sendstring to say:
Last edit: Larry 2023-12-01
I can see a mismatch of quotes in the sendstring = line, the first single quote is not being matched with the last as that's in double quotes. The number of double quotes around the notify-send payload will then not match, so will need fixing.
I'm not sure why the interpret statement is needed here, it's very powerful when needed, but also totally opaque, so a comment explaining what it's expected to look like when run is essential. Usually when writing the comment the way to avoid interpret jumps out in better logic.
Sorry, I edited my post to add "Here's what I want the sendstring to say:" but then I neglected to add the example.
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u larry)/bus /usr/bin/notify-send -t 0 "randy - Test 3.14"
I think my problem is that I don't know enough about 'address system' .
I have 'The Regina Rexx Interpreter Version 3.3', and the examples all seem to say that I need to quote the entire string.
However, I did just figure out that I can use a variable to hold the string, which would not require an 'interpret'.
So I did figure it out, but not until I read your response, which gave me a few clues.
Thanks very much.
Here's how I did it. I have a lot more to go into it, but the rest should be easy.