The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
bash script quesiton - if any file exists then ...
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
bash script quesiton - if any file exists then ...
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
02-10-2009
hare_krishna
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
hare_krishna
View Public Profile
Find all posts by hare_krishna
Find hare_krishna's past nominations received
Find hare_krishna's present nominations given