Re: Off Topic - Bash Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Once upon a time, Bill Gradwohl <bill@xxxxxxx> said:
> # This works
> fileName='abc.xyz'
> md5sum=$(md5sum ${fileName})
> 
> # This doesn't
> fileName='spaces in file name.xyz'
> md5sum=$(md5sum ${fileName})

# How about
fileName='spaces in file name.xyz'
md5sum=$(md5sum "${fileName}")

The key is that you need to put quotes around the file name (using
double quotes; single quotes block variable expansion).
-- 
Chris Adams <cmadams@xxxxxxxxxx>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux