The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
'end of file' unexpected srisreeku Shell Programming and Scripting 1 04-28-2008 02:39 PM
end of file unexpected naveeng.81 Shell Programming and Scripting 1 03-11-2008 06:43 AM
unexpected 'end of file' + sed command kamel.seg High Level Programming 1 02-08-2008 11:00 AM
gunzip: unexpected end of file sicjedi UNIX for Advanced & Expert Users 4 09-15-2006 10:41 AM
'end of file' unexpected abhijeetkul Shell Programming and Scripting 4 04-10-2006 06:42 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-15-2007
dineshr85 dineshr85 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 23
unexpected end of file

This is the script

path=/oracle/ora10gdb/sample
archive=/oracle/ora10gdb/archive

cd $path
for i in `ls`;do
mv $i $archive
Done


Please tell me why it is givind this error
  #2 (permalink)  
Old 10-15-2007
gyana_cboy gyana_cboy is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 9
The code what you have written is absolutely correct ...and it is not giving any errors.
i tried with your code by creating the files in my home directory....


Please segregate the do part from the line whre you are putting the semicolon..
can you tell me in which operating system you are working ...(may be it depends upon the o/s)


Try with this it will transfer the file .....
from one directory to another


path=/oracle/ora10gdb/sample
archive=/oracle/ora10gdb/archive
cd $path
echo `pwd`
for file in `ls`
do
mv $file $archive
done
  #3 (permalink)  
Old 10-15-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
'Done' must be in lowercase.

Also the code choice is very poor, it will break fo any file with a space in it.

Code:
for file in * ; do
    mv "$i" "$srchive"
done
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0