Hello,
When I run following script
#!/bin/bash
cd ~/directory1
mv `ls -trF | grep -v / | tail -10 ` ~/directory2
works fine with filenames not having any space but runs into issues with filenames that have spaces tried with $file variable still doesnot work. Can someone help me
divzz
April 27, 2009, 2:05am
2
try putting your filename within quotes.. like "my file".
divzz
April 27, 2009, 2:14am
3
I m sorry didnt read the question properly n jumped to reply..
panyam
April 27, 2009, 3:33am
4
Try some thing lik this
find . -type f -exec mv {} ./DIR_NAME \;
Check for more option flags of find for ur needs.
in script include $file in quotes as "$file"
and while passing the path to script pass in quotes as
"/root/directory first"
this will work fine.