Ask Your Question
0

Running an executable from terminal, and make it read a file?

asked 2015-08-19 19:10:17 -0600

Sandbo gravatar image

Hi,

I am trying to run fasthenry, which is a .sh executable in folder A. I have a txt files test.inp that I want fasthenry to read, which is stored in folder B.

So on cd to the root folder of A and B, I typed: ./A/fasthenry /B/test.inp

I could run fasthenry with the correct prompts coming out, however, fasthenry couldn't really find the file to open.

May I know what I was missing for it to run like I wanted? I tried putting test.inp into folder A while it didn't help.

Many thanks for your kind attention.

edit retag flag offensive close merge delete

Comments

This question is not related to Fedora.

skytux gravatar imageskytux ( 2015-08-19 21:24:21 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-08-20 03:30:51 -0600

pnadk gravatar image

This is a stackoverflow kind of question. But I think you are missing the "<" to let a program read input from a file.

edit flag offensive delete link more
0

answered 2015-08-20 14:52:31 -0600

I am assuming that your fasthenry.sh script is written properly to read input from another file.

Please check to see if the file and folder permissions of /B/test.inp will allow the user running fasthenry.sh to read the file. You can check permissions with the ls command.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-08-19 19:10:17 -0600

Seen: 115 times

Last updated: Aug 20 '15