Register
It is currently Sun Dec 21, 2014 11:56 pm

For statement to make symbolic links


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Mon Jul 28, 2014 6:34 am   

Joined: Mon Jul 28, 2014 6:29 am
Posts: 1
Dear All,
im very new in Linux, please advice me to make symbolik links of files of a folder, but just the files that are listed in the text file.
are wrote in this way:
Code:
#!/bin/bash
INFILE=/media/xubuntu/david/Cascades/WM2014/files.txt
COUNT=804
SDIR="/media/xubuntu/david/Cascades/WM2014/general/"
PREFIX="wm"
TDIR="/media/xubuntu/david/Cascades/WM2014/links/"
for FN in $(head -$COUNT $INFILE | cut -d ";" -f 1 | tr '[A-Z]' '[a-z]')
do
  ln -s $SDIR$PREFIX$FN.xz $TDIR$PREFIX$FN.xz
done



the text file which is our list, is like this

simplexxxx.json.xz;
recordxxxx.json.xz;


but i get this error
exportlink.sh: line 8: syntax error near unexpected token `$'do\r''
'xportlink.sh: line 8: `do


Thank you in advance.

Best,
David


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP