Skip to content

Commit caacfbd

Browse files
committed
fix(post_action): replace head with sed for removing last line
• Replaced head --lines=-1 with sed '$ d' to remove the last line from SSH_KNOWN_HOSTS_FILE. • Ensured compatibility and consistency in processing the known_hosts file. • Simplified command usage while maintaining functionality.
1 parent 07fdbb0 commit caacfbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

post_action.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SSH_KNOWN_HOSTS_FILE="${HOME}/.ssh/known_hosts"
44
TEMP_FILE="/tmp/718f4157-5493-43b2-837b-3ccb27f78e7b"
55

6-
head --lines=-1 "${SSH_KNOWN_HOSTS_FILE}" > "${TEMP_FILE}"
6+
sed '$ d' file "${SSH_KNOWN_HOSTS_FILE}" > "${TEMP_FILE}"
77
cat "${TEMP_FILE}" > "${SSH_KNOWN_HOSTS_FILE}"
88
rm -rf "${TEMP_FILE}"
99

0 commit comments

Comments
 (0)