Does this happen in all Linux systems? It’s weird
I always end up with these random values in my directory where I’m running bash scripts when things exit with various values.
In the most recent example I exit a script with 1 on error:
dockerfile="../../job-$image/Dockerfile"
if [ ! -f $dockerfile ]; then
echo "Dockerfile: $dockerfile does not exist"
exit 1
fi
I was testing to see if that code worked and when the file doesn’t exist and the code exits, I get a 1 in the directory where I’m executing the script. Meaning there’s a file named “1”. Why? I then have to delete it.
A few times I’ve had a character show up like ~ or *.
What happens when you run:
rm ~
or
rm *
Not good right?
I think that issue may have been fixed by have to remember to put quotes around those values to avoid deleting your home directory or all the files in the current directory.
Why do these weird things show up as files? Seems like a bug. Why would you ever really want this to happen?
Follow for updates.
Teri Radichel | © 2nd Sight Lab 2023
The best way to support this blog is to sign up for the email list and clap for stories you like. If you are interested in IANS Decision Support services so you can schedule security consulting calls with myself and other IANS faculty, please reach out on LinkedIn via the link below. Thank you!
About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
Author: Cybersecurity for Executives in the Age of Cloud
Presentations: Presentations by Teri Radichel
Recognition: SANS Difference Makers Award, AWS Security Hero, IANS Faculty
Certifications: SANS
Education: BA Business, Master of Software Engineering, Master of Infosec
Company: Cloud Penetration Tests, Assessments, Training ~ 2nd Sight Lab
Like this story? Use the options below to help me write more!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❤️ Clap
❤️ Referrals
❤️ Medium: Teri Radichel
❤️ Email List: Teri Radichel
❤️ Twitter: @teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
❤️ Buy a Book: Teri Radichel on Amazon
❤️ Request a penetration test, assessment, or training
via LinkedIn: Teri Radichel
❤️ Schedule a consulting call with me through IANS Research

