script appears to run with no progress

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












This script is to find a list of files stored in a text file, and if the files are found, copy them to a specific location. So far I have had success running the portions up to but not including the portion that actually copies the files. When I add the code to copy the file, starting with exec, the script no longer appears to work and makes no progress. I would like to understand what is locking this script up and how to make it work correctly. Thanks!



#!/bin/bash
#Find files from a list in a file and copy them to a common folder

mapfile -t filelist < filelist.txt

for file in "$filelist[@]"; do
xargs find ~ -name '$filelist[@]' -exec mv -t ~/Document/foundfiles/ +;
done






share|improve this question















  • 1




    xargs (which is superfluous, as far as I can see) is waiting for standard input
    – steeldriver
    May 8 at 0:50










  • I'll get rid of that, that was from an old iteration. That was apparently masking another problem, thanks.
    – user289380
    May 8 at 1:05











  • ... also presumably it should be -name "$file"
    – steeldriver
    May 8 at 1:08










  • Yes, that has made more progress, thank you!
    – user289380
    May 8 at 1:12










  • You solved it! thanks!
    – user289380
    May 8 at 1:16














up vote
0
down vote

favorite












This script is to find a list of files stored in a text file, and if the files are found, copy them to a specific location. So far I have had success running the portions up to but not including the portion that actually copies the files. When I add the code to copy the file, starting with exec, the script no longer appears to work and makes no progress. I would like to understand what is locking this script up and how to make it work correctly. Thanks!



#!/bin/bash
#Find files from a list in a file and copy them to a common folder

mapfile -t filelist < filelist.txt

for file in "$filelist[@]"; do
xargs find ~ -name '$filelist[@]' -exec mv -t ~/Document/foundfiles/ +;
done






share|improve this question















  • 1




    xargs (which is superfluous, as far as I can see) is waiting for standard input
    – steeldriver
    May 8 at 0:50










  • I'll get rid of that, that was from an old iteration. That was apparently masking another problem, thanks.
    – user289380
    May 8 at 1:05











  • ... also presumably it should be -name "$file"
    – steeldriver
    May 8 at 1:08










  • Yes, that has made more progress, thank you!
    – user289380
    May 8 at 1:12










  • You solved it! thanks!
    – user289380
    May 8 at 1:16












up vote
0
down vote

favorite









up vote
0
down vote

favorite











This script is to find a list of files stored in a text file, and if the files are found, copy them to a specific location. So far I have had success running the portions up to but not including the portion that actually copies the files. When I add the code to copy the file, starting with exec, the script no longer appears to work and makes no progress. I would like to understand what is locking this script up and how to make it work correctly. Thanks!



#!/bin/bash
#Find files from a list in a file and copy them to a common folder

mapfile -t filelist < filelist.txt

for file in "$filelist[@]"; do
xargs find ~ -name '$filelist[@]' -exec mv -t ~/Document/foundfiles/ +;
done






share|improve this question











This script is to find a list of files stored in a text file, and if the files are found, copy them to a specific location. So far I have had success running the portions up to but not including the portion that actually copies the files. When I add the code to copy the file, starting with exec, the script no longer appears to work and makes no progress. I would like to understand what is locking this script up and how to make it work correctly. Thanks!



#!/bin/bash
#Find files from a list in a file and copy them to a common folder

mapfile -t filelist < filelist.txt

for file in "$filelist[@]"; do
xargs find ~ -name '$filelist[@]' -exec mv -t ~/Document/foundfiles/ +;
done








share|improve this question










share|improve this question




share|improve this question









asked May 8 at 0:43







user289380














  • 1




    xargs (which is superfluous, as far as I can see) is waiting for standard input
    – steeldriver
    May 8 at 0:50










  • I'll get rid of that, that was from an old iteration. That was apparently masking another problem, thanks.
    – user289380
    May 8 at 1:05











  • ... also presumably it should be -name "$file"
    – steeldriver
    May 8 at 1:08










  • Yes, that has made more progress, thank you!
    – user289380
    May 8 at 1:12










  • You solved it! thanks!
    – user289380
    May 8 at 1:16












  • 1




    xargs (which is superfluous, as far as I can see) is waiting for standard input
    – steeldriver
    May 8 at 0:50










  • I'll get rid of that, that was from an old iteration. That was apparently masking another problem, thanks.
    – user289380
    May 8 at 1:05











  • ... also presumably it should be -name "$file"
    – steeldriver
    May 8 at 1:08










  • Yes, that has made more progress, thank you!
    – user289380
    May 8 at 1:12










  • You solved it! thanks!
    – user289380
    May 8 at 1:16







1




1




xargs (which is superfluous, as far as I can see) is waiting for standard input
– steeldriver
May 8 at 0:50




xargs (which is superfluous, as far as I can see) is waiting for standard input
– steeldriver
May 8 at 0:50












I'll get rid of that, that was from an old iteration. That was apparently masking another problem, thanks.
– user289380
May 8 at 1:05





I'll get rid of that, that was from an old iteration. That was apparently masking another problem, thanks.
– user289380
May 8 at 1:05













... also presumably it should be -name "$file"
– steeldriver
May 8 at 1:08




... also presumably it should be -name "$file"
– steeldriver
May 8 at 1:08












Yes, that has made more progress, thank you!
– user289380
May 8 at 1:12




Yes, that has made more progress, thank you!
– user289380
May 8 at 1:12












You solved it! thanks!
– user289380
May 8 at 1:16




You solved it! thanks!
– user289380
May 8 at 1:16















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442432%2fscript-appears-to-run-with-no-progress%23new-answer', 'question_page');

);

Post as a guest


































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442432%2fscript-appears-to-run-with-no-progress%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay