Sample Header Ad - 728x90

Bash scripting: Last line - "exit" - necessary?

2 votes
2 answers
1431 views
another basic, innocent question: When you make a bash script, you could close it with, you could type in as last line of the script,
,
echo "Hello world!"
exit
, is it advised, should one generally close a script with
? I could imagine, that basically from IT-security perspective it's better to set a definitive end to a script. I could imagine, that otherwise it would be an open end, never closing, always luring in the background, and potentially could be exploited somehow, or simply just wasting resources…
Asked by futurewave (213 rep)
Jun 7, 2024, 05:37 PM
Last activity: Jun 7, 2024, 06:02 PM