Properly feed paths to executables in bash script

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











up vote
0
down vote

favorite












Hello all I have a text file (1.txt) that contains full paths to binaries which I need to execute a command (val_bin) for each path in the file.



1.txt Example:



/source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin 
/source/ed/dev/ed/ab/ed_lap/comercial/bin/APP2.bin
/source/ed/dev/ed/ab/ky_len/Industrial/bin/APP3.bin
...


Command Example: val_bin- Creates an html file for every record in 1.txt

e.g.



val_bin -output <DESTINATION.html> -path </source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin>


where -output should have the path where the html files will be created after each time the command ends ("DESTINATION").
where -output should specify name.bin.html (e.g. App1.bin.html)



where -path needs to be the entire path fed into the command



example output: (where /tmp is the destination of the html files)



> ll /tmp
/tmp/APP1.bin.html
/tmp/APP2.bin.html
/tmp/APP3.bin.html
...


Ive tried several different loop options but now am investigating pure awk. I am sure I am doing soemthing stupid! Thanks in advance!









share





















  • What is your actual problem here... the output file name ?
    – don_crissti
    4 mins ago














up vote
0
down vote

favorite












Hello all I have a text file (1.txt) that contains full paths to binaries which I need to execute a command (val_bin) for each path in the file.



1.txt Example:



/source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin 
/source/ed/dev/ed/ab/ed_lap/comercial/bin/APP2.bin
/source/ed/dev/ed/ab/ky_len/Industrial/bin/APP3.bin
...


Command Example: val_bin- Creates an html file for every record in 1.txt

e.g.



val_bin -output <DESTINATION.html> -path </source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin>


where -output should have the path where the html files will be created after each time the command ends ("DESTINATION").
where -output should specify name.bin.html (e.g. App1.bin.html)



where -path needs to be the entire path fed into the command



example output: (where /tmp is the destination of the html files)



> ll /tmp
/tmp/APP1.bin.html
/tmp/APP2.bin.html
/tmp/APP3.bin.html
...


Ive tried several different loop options but now am investigating pure awk. I am sure I am doing soemthing stupid! Thanks in advance!









share





















  • What is your actual problem here... the output file name ?
    – don_crissti
    4 mins ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Hello all I have a text file (1.txt) that contains full paths to binaries which I need to execute a command (val_bin) for each path in the file.



1.txt Example:



/source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin 
/source/ed/dev/ed/ab/ed_lap/comercial/bin/APP2.bin
/source/ed/dev/ed/ab/ky_len/Industrial/bin/APP3.bin
...


Command Example: val_bin- Creates an html file for every record in 1.txt

e.g.



val_bin -output <DESTINATION.html> -path </source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin>


where -output should have the path where the html files will be created after each time the command ends ("DESTINATION").
where -output should specify name.bin.html (e.g. App1.bin.html)



where -path needs to be the entire path fed into the command



example output: (where /tmp is the destination of the html files)



> ll /tmp
/tmp/APP1.bin.html
/tmp/APP2.bin.html
/tmp/APP3.bin.html
...


Ive tried several different loop options but now am investigating pure awk. I am sure I am doing soemthing stupid! Thanks in advance!









share













Hello all I have a text file (1.txt) that contains full paths to binaries which I need to execute a command (val_bin) for each path in the file.



1.txt Example:



/source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin 
/source/ed/dev/ed/ab/ed_lap/comercial/bin/APP2.bin
/source/ed/dev/ed/ab/ky_len/Industrial/bin/APP3.bin
...


Command Example: val_bin- Creates an html file for every record in 1.txt

e.g.



val_bin -output <DESTINATION.html> -path </source/ed/dev/ed/ab/ed_len/comercial/bin/APP1.bin>


where -output should have the path where the html files will be created after each time the command ends ("DESTINATION").
where -output should specify name.bin.html (e.g. App1.bin.html)



where -path needs to be the entire path fed into the command



example output: (where /tmp is the destination of the html files)



> ll /tmp
/tmp/APP1.bin.html
/tmp/APP2.bin.html
/tmp/APP3.bin.html
...


Ive tried several different loop options but now am investigating pure awk. I am sure I am doing soemthing stupid! Thanks in advance!







bash awk path for





share












share










share



share










asked 9 mins ago









SSDdude

786




786











  • What is your actual problem here... the output file name ?
    – don_crissti
    4 mins ago
















  • What is your actual problem here... the output file name ?
    – don_crissti
    4 mins ago















What is your actual problem here... the output file name ?
– don_crissti
4 mins ago




What is your actual problem here... the output file name ?
– don_crissti
4 mins ago















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%2f475665%2fproperly-feed-paths-to-executables-in-bash-script%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%2f475665%2fproperly-feed-paths-to-executables-in-bash-script%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