Hello,
I apologize if this was addressed in a previous post. I have done some searching but may have missed it. I am trying to read a list from a file, for example:
and using this list, copy files with these names (ex: 3bik.dssp.Z) to a seperate folder, named Subset. [Kindly note that all files have the same .dssp.Z extension, they only differ in the names!]
I have written this code below but keep getting syntax errors...could you kindly tell me what I am doing wrong? I am new to scripting and I apologize in advance for any silly errors!
The code:
I have saved this as Test.sh
My understanding now is that I simply call: bash Test.sh
in the commandline (MacOs by the way)
Please correct me if I'm wrong, and let me know if the logic of the code is correct also.
Many thanks,
InfoSeeker
When posting about getting errors, post the errors, even for a simple script, it's much easier for people to help if you do.
It is not a good idea to cat a file into a while loop because you will break the script is any files have spaces in their names although the script looks like it should have worked. Thy adding the {..} to $Line as below in case you are getting some kind of misinterpretation of the variable name, or you might have blank lines in the input file.
Hi All,
i'm trying to copy the 1.txt files (sample files) in to different path location using the below command.
But it is not copying the files , when i tried for single location able to copy the file.
can any one please assist here.
Please find the below path :-
/ckr_mkr1/licencekey... (2 Replies)
Dear All,
I have a situation where I want to copy some files of type .txt.
These files are o/p from one program. Some of the files are named as
fileName .txt instead of fileName.txt
after fileName by mistake I have specified "space". Now I want to move these files as follows.
mv fileName*... (13 Replies)
I want to write a shell script to copy a list of files from one directory to another. And while copying it should change the first character of the filename to uppercase and others to lowercase.Below is what i have tried so far.
for file in "$@"
do
if
then
ufile=`echo $file | sed... (5 Replies)
I have installed Solaris 10 on a Sunblade 150 (512 MB RAM) successfully. But when I create a new directory and try to copy a 40 MB file to it it stops after about 37 MB and gives an error "I/O error" while copying. I have 40GB of Hard Disk. What is the problem? (8 Replies)
Hi All,
I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files.
To Do
From Directory : /myproject/MainDir
To Directory : /myproject/data
List of files need to copy is in the file: /myproject/filesList.txt
... (4 Replies)
Hi,
I just need a shell script that copies a list of files from a directory in a remote server to my current directory at local server
the remote server may contain the following list:
/root/pradeep/myfiles/default
/root/pradeep/myfiles/dir1
/root/pradeep/myfiles/dir2
...... (1 Reply)
Hi Unix Gurus,
I have a doubt reg file transfer. I have used the below script to connect to another server and find files having modified for the last 24 hours and have to move the file to another server.
While i tried i am getting authentication failed, destination path not found issue.
... (2 Replies)
I am trying copy all files ,i was getting below error .Please any idea
#find . -name "*bat" -exec cp -p {} /devt/jobs
find: incomplete statement
Thanks,
Akil (9 Replies)
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)
Hi,
I have a problem.
I have some text files in a folder. The names can be like:
emp.txt
emp1.txt
emp3.txt
32emp4.txt
What i need is i have to copy all the files which have "emp" string in their filename
to a different folder and those file names... (7 Replies)