Skip to content

Commit

Permalink
add diff parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dolevf committed Apr 14, 2024
1 parent b982d04 commit aadf4ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ch06/os-command-injection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ while true; do
new_resp=$(curl -s "http://${host}:${port}/amount_to_donate.txt")

# Extract only the difference between the two command outputs
delta=$(diff <(echo "${prev_resp}") <(echo "${new_resp}") --line-format=%L)
delta=$(diff --new-line-format="%L" \
--unchanged-line-format="" \
<(echo "${prev_resp}") <(echo "${new_resp}"))

# Output the command result
echo "${delta}"
Expand Down

0 comments on commit aadf4ae

Please sign in to comment.