New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell lesson, No.7 [Last exercise] - Better to not hard-code the username #696

Open
wants to merge 1 commit into
base: gh-pages
from

Conversation

Projects
None yet
2 participants
@amit491

amit491 commented Jan 30, 2018

The last exercise (shell-novice, lesson no.7): "Finding files with different properties"
It is asking to find files modified by user 'ahmed' in last 24 hrs.

But not necessarily the workshop attendee would have that user name in his/her PC/Mac. And also, when I downloaded and unzipped the shell-novice-data.zip, none of the files in the uncompressed folder are of user 'ahmed'.

Hence it would be better to catch the username on the fly using the command that has already been introduced in lesson no.2.

Hence instead of this as solution -
find ./ -type f -mtime -1 -user ahmed

I suggest this -
find ./ -type f -mtime -1 -user $(whoami)

@gdevenyi

This comment has been minimized.

Contributor

gdevenyi commented Jan 30, 2018

This looks okay, but I'd like the command broken out so the user checks their ownership first on a separate line.

Also, there's a bunch of whitespace changes, can you clobber those and rebase?

@amit491

This comment has been minimized.

amit491 commented Jan 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment