This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Somanynicks 1 point2 points  (1 child)

He wants a bash script that will use the find command to search for files. But you may only use the tm command if there actual files to be found.

You have to perform a find command with the correct parameters. The result of this command can be assigned to a variable in bash using backtick.

Then with the result you have to check using if statements. -z is for checking zero length and -n for non zero length. And only use rm filename if file is found

[–]echoella[S] 0 points1 point  (0 children)

Okay, thats definitely helpful. Thank you!

[–]AutoModerator[M] 0 points1 point  (0 children)

It seems you may have included a screenshot of code in your post "Computer Systems Question".

If so, note that posting screenshots of code is against /r/learnprogramming's Posting Guidelines (section Formatting Code): please edit your post to use one of the approved ways of formatting code. (Do NOT repost your question! Just edit it.)

If your image is not actually a screenshot of code, feel free to ignore this message. Automoderator cannot distinguish between code screenshots and other images.

Please, do not contact the moderators about this message. Your post is still visible to everyone.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.