[K12OSN] Script Error with file names that have spaces

Jim Kronebusch jim at winonacotter.org
Wed Sep 1 16:12:16 UTC 2004


> Put the $file in side double quotes  For example:
> 
>  chown -R $owner "$file"

Thanks Jeff and Dave.  Between both of your suggestions I now have
things working again with the following:

#!/bin/bash
for file in /home/Drop/*
do owner=$(ls -ld \
"$file"\
|awk '{print $3}')
chown -R $owner \
"$file"
Done


This is what makes this list awesome.

Thanks again.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004
 


-- 
This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.





More information about the K12OSN mailing list