From 9a3a784c656ba13bc0ccac9d9860f76dd20bf7fc Mon Sep 17 00:00:00 2001 From: GLVS Kiriti Date: Tue, 26 Mar 2024 22:25:47 +0530 Subject: [PATCH] Refactor command execution to use a dynamic script path and also added comments Signed-off-by: GLVS Kiriti --- events/syscall/execution_from_dev_shm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/syscall/execution_from_dev_shm.go b/events/syscall/execution_from_dev_shm.go index 8a0a4388..1f0acd76 100644 --- a/events/syscall/execution_from_dev_shm.go +++ b/events/syscall/execution_from_dev_shm.go @@ -52,7 +52,7 @@ func ExecutionFromDevShm(h events.Helper) error { return err } - cmd := exec.Command("sh", "-c", "cd /dev/shm/ && ./example_script-created-by-falco-event-generator.sh") - defer os.Remove(scriptPath) // Remove script file + cmd := exec.Command("sh", "-c", scriptPath) // Execute script file + defer os.Remove(scriptPath) // Remove script file return cmd.Run() }