Page 1 of 1

A sysadmins guide to Bash

Posted: Tue Jul 31, 2018 10:29 pm
by crosscourt

Re: A sysadmins guide to Bash

Posted: Wed Aug 01, 2018 11:19 am
by chris
I really disagree with his line "for file in $(ls)". Of course this should be "for file in *".

Re: A sysadmins guide to Bash

Posted: Wed Aug 01, 2018 10:16 pm
by crosscourt
You might want to contact him and let him know.

Re: A sysadmins guide to Bash

Posted: Thu Aug 02, 2018 12:39 am
by dai_trying
I think that example was used just to illustrate why you shouldn't use back-ticks rather than saying it is the best command to use for a file list, personally I tend to use python when I want to get those sort of results and sometimes I even source a python script to get the filenames (and paths if required) and parse it back into the bash script but I find it a bit tedious so usually just use python for the whole thing.