What is wrong in this shell script?What does the syntax on this shell command with extglob mean?What is wrong...

Can I use both 気温 and 温度 when asking for the weather temperature?

My professor says my digit summing code is flawed. Is he right?

What's the most efficient way to draw this region?

Does the Wall of Stone spell need support or not?

5v home network

Why is CMYK & PNG not possible?

Is data science mathematically interesting?

Can every language be categorized as either compiled or interpreted?

Fantasy novel/series with young man who discovers he can use magic that is outlawed

Novel set in the future, children cannot change the class they are born into, one class is made uneducated by associating books with pain

Why is it so hard to land on the Moon?

Would removing the "total cover" part of a Paladin's Divine Sense unbalance the feature?

Is it possible to do a low carb diet for a month in Sicily?

Are there any rules around when something can be described as "based on a true story"?

Is there a practical way of making democratic-like system skewed towards competence?

How do I weigh a kitchen island to determine what size castors to get?

Is consistent disregard for students' time "normal" in undergraduate research?

How to respond when insulted by a grad student in a different department?

'Kukhtarev's model' or 'THE Kukhtarev's model'?

Can you take Bowwow out after returning him to MeowMeow?

Can you decide not to sneak into a room after seeing your roll?

I'm not alive, but I can be lively

How to execute a project with two resources where you need three resources?

How can I attach a set of five panniers?



What is wrong in this shell script?


What does the syntax on this shell command with extglob mean?What is wrong with this call to sed -i?How to script this task?AIX shell script compileruntar shell scriptScript to compare and delete the files based on name and extension type






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}








0

















It can not generate two temp-files!
Why not? Please help!!
The input-file has two columns for the file names.
But it fails to copy the files "fn1", "fn2" into "Data1.dat", "Data2.dat"



What is wrong here??



#!/bin/bash

FF1=$1
while IFS=" " read -r line1 line2;
do
fn1="$line1"
fn2="$line2"

cp $fn1 Data1.dat;
cp $fn2 Data2.dat;

...other ext-scripts!...

done > $FF1


This code failed to copy so as to generate those two temporary data-files!
There are "error-messages for cp-operation lines"



Please help to make the two files correctly.
Thx.










share|improve this question









New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























  • done > $FF1 -- you are writing to that file, not reading from.

    – glenn jackman
    32 mins ago











  • Could you be more specific?? I'm a real-beginner of this kind of script, starting today. The problem is that this code can not copy those "Data1.dat", "Data2.dat" files...!! P.S) I'm doing an iterative works using this code to run ext-script by reading line by line from another file~!

    – David
    15 mins ago




















0

















It can not generate two temp-files!
Why not? Please help!!
The input-file has two columns for the file names.
But it fails to copy the files "fn1", "fn2" into "Data1.dat", "Data2.dat"



What is wrong here??



#!/bin/bash

FF1=$1
while IFS=" " read -r line1 line2;
do
fn1="$line1"
fn2="$line2"

cp $fn1 Data1.dat;
cp $fn2 Data2.dat;

...other ext-scripts!...

done > $FF1


This code failed to copy so as to generate those two temporary data-files!
There are "error-messages for cp-operation lines"



Please help to make the two files correctly.
Thx.










share|improve this question









New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























  • done > $FF1 -- you are writing to that file, not reading from.

    – glenn jackman
    32 mins ago











  • Could you be more specific?? I'm a real-beginner of this kind of script, starting today. The problem is that this code can not copy those "Data1.dat", "Data2.dat" files...!! P.S) I'm doing an iterative works using this code to run ext-script by reading line by line from another file~!

    – David
    15 mins ago
















0












0








0








It can not generate two temp-files!
Why not? Please help!!
The input-file has two columns for the file names.
But it fails to copy the files "fn1", "fn2" into "Data1.dat", "Data2.dat"



What is wrong here??



#!/bin/bash

FF1=$1
while IFS=" " read -r line1 line2;
do
fn1="$line1"
fn2="$line2"

cp $fn1 Data1.dat;
cp $fn2 Data2.dat;

...other ext-scripts!...

done > $FF1


This code failed to copy so as to generate those two temporary data-files!
There are "error-messages for cp-operation lines"



Please help to make the two files correctly.
Thx.










share|improve this question









New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











It can not generate two temp-files!
Why not? Please help!!
The input-file has two columns for the file names.
But it fails to copy the files "fn1", "fn2" into "Data1.dat", "Data2.dat"



What is wrong here??



#!/bin/bash

FF1=$1
while IFS=" " read -r line1 line2;
do
fn1="$line1"
fn2="$line2"

cp $fn1 Data1.dat;
cp $fn2 Data2.dat;

...other ext-scripts!...

done > $FF1


This code failed to copy so as to generate those two temporary data-files!
There are "error-messages for cp-operation lines"



Please help to make the two files correctly.
Thx.







shell scripting template






share|improve this question









New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question



share|improve this question








edited 3 mins ago







David













New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 41 mins ago









DavidDavid

11 bronze badge




11 bronze badge




New contributor



David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















  • done > $FF1 -- you are writing to that file, not reading from.

    – glenn jackman
    32 mins ago











  • Could you be more specific?? I'm a real-beginner of this kind of script, starting today. The problem is that this code can not copy those "Data1.dat", "Data2.dat" files...!! P.S) I'm doing an iterative works using this code to run ext-script by reading line by line from another file~!

    – David
    15 mins ago





















  • done > $FF1 -- you are writing to that file, not reading from.

    – glenn jackman
    32 mins ago











  • Could you be more specific?? I'm a real-beginner of this kind of script, starting today. The problem is that this code can not copy those "Data1.dat", "Data2.dat" files...!! P.S) I'm doing an iterative works using this code to run ext-script by reading line by line from another file~!

    – David
    15 mins ago



















done > $FF1 -- you are writing to that file, not reading from.

– glenn jackman
32 mins ago





done > $FF1 -- you are writing to that file, not reading from.

– glenn jackman
32 mins ago













Could you be more specific?? I'm a real-beginner of this kind of script, starting today. The problem is that this code can not copy those "Data1.dat", "Data2.dat" files...!! P.S) I'm doing an iterative works using this code to run ext-script by reading line by line from another file~!

– David
15 mins ago







Could you be more specific?? I'm a real-beginner of this kind of script, starting today. The problem is that this code can not copy those "Data1.dat", "Data2.dat" files...!! P.S) I'm doing an iterative works using this code to run ext-script by reading line by line from another file~!

– David
15 mins ago












0






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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});







David is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded
















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f545208%2fwhat-is-wrong-in-this-shell-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown


























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes









David is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded

















David is a new contributor. Be nice, and check out our Code of Conduct.













David is a new contributor. Be nice, and check out our Code of Conduct.












David is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f545208%2fwhat-is-wrong-in-this-shell-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m