Skip to content
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

wants to merge 1 commit into
base: gh-pages


Copy link

@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, 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)

Copy link

@gdevenyi 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?

Copy link

@amit491 amit491 commented Jan 31, 2018

Copy link

@gcapes gcapes commented Jan 16, 2019

Thanks for the contribution!

I think it would be great if the exercise was runable rather than just a thought experiment. Which directory should the learner be in for this exercise?

I'd also like to add that whoami is not covered anywhere in this course.

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

Successfully merging this pull request may close these issues.

None yet

4 participants