The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 02-10-2009
hare_krishna hare_krishna is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 2
You can try

#!/bin/bash

while ( `ls -1 /source/*|head -1` )
do
file=`ls -1 /source/*|head -1`
mv /source/$file /target
done