Ambiguous Input Redirect Java [closed]
On Fedora 28 I'm trying to redirect from Standard Input a .txt file saved in the same folder of my java program; I wrote in terminal
cd folderPath
java ClassName < `FileName.txt`
but I got this message
bash: FileName.txt: command not found...
bash: `FileName.txt`: ambiguos redirection
where I'm wrong? Thanks!
java linux input io-redirection
closed as off-topic by jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk Dec 30 '18 at 9:37
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
On Fedora 28 I'm trying to redirect from Standard Input a .txt file saved in the same folder of my java program; I wrote in terminal
cd folderPath
java ClassName < `FileName.txt`
but I got this message
bash: FileName.txt: command not found...
bash: `FileName.txt`: ambiguos redirection
where I'm wrong? Thanks!
java linux input io-redirection
closed as off-topic by jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk Dec 30 '18 at 9:37
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk
If this question can be reworded to fit the rules in the help center, please edit the question.
Stack Overflow is a site for programming and development questions. You should use another site on the Stack Exchange network for this question.
– jww
Dec 29 '18 at 23:26
add a comment |
On Fedora 28 I'm trying to redirect from Standard Input a .txt file saved in the same folder of my java program; I wrote in terminal
cd folderPath
java ClassName < `FileName.txt`
but I got this message
bash: FileName.txt: command not found...
bash: `FileName.txt`: ambiguos redirection
where I'm wrong? Thanks!
java linux input io-redirection
On Fedora 28 I'm trying to redirect from Standard Input a .txt file saved in the same folder of my java program; I wrote in terminal
cd folderPath
java ClassName < `FileName.txt`
but I got this message
bash: FileName.txt: command not found...
bash: `FileName.txt`: ambiguos redirection
where I'm wrong? Thanks!
java linux input io-redirection
java linux input io-redirection
edited Dec 29 '18 at 16:01
Jonathan Rosenne
1,368818
1,368818
asked Dec 29 '18 at 10:45
Bug-GyBug-Gy
104
104
closed as off-topic by jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk Dec 30 '18 at 9:37
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk
If this question can be reworded to fit the rules in the help center, please edit the question.
closed as off-topic by jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk Dec 30 '18 at 9:37
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – jww, Tsyvarev, greg-449, Billal Begueradj, Tomasz Mularczyk
If this question can be reworded to fit the rules in the help center, please edit the question.
Stack Overflow is a site for programming and development questions. You should use another site on the Stack Exchange network for this question.
– jww
Dec 29 '18 at 23:26
add a comment |
Stack Overflow is a site for programming and development questions. You should use another site on the Stack Exchange network for this question.
– jww
Dec 29 '18 at 23:26
Stack Overflow is a site for programming and development questions. You should use another site on the Stack Exchange network for this question.
– jww
Dec 29 '18 at 23:26
Stack Overflow is a site for programming and development questions. You should use another site on the Stack Exchange network for this question.
– jww
Dec 29 '18 at 23:26
add a comment |
1 Answer
1
active
oldest
votes
You are using the wrong quote:
java ClassName < `FileName.txt`
The ` will evaluate to a shell subcommand, whose name is FileName.txt
.
What you want is single or double quote:
java ClassName < 'FileName.txt' # 1
java ClassName < "FileName.txt" # 2
java ClassName < FileName.txt # 3
- Single quote disallow expansion (eg: no
'${FILE}'
) - Double quote allow expansion (eg:
"${FILE}"
resolve tofoobar
ifexport FILE=foobar
) - Quote are not needed when the path does not contains specific characters, such as space.
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You are using the wrong quote:
java ClassName < `FileName.txt`
The ` will evaluate to a shell subcommand, whose name is FileName.txt
.
What you want is single or double quote:
java ClassName < 'FileName.txt' # 1
java ClassName < "FileName.txt" # 2
java ClassName < FileName.txt # 3
- Single quote disallow expansion (eg: no
'${FILE}'
) - Double quote allow expansion (eg:
"${FILE}"
resolve tofoobar
ifexport FILE=foobar
) - Quote are not needed when the path does not contains specific characters, such as space.
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
add a comment |
You are using the wrong quote:
java ClassName < `FileName.txt`
The ` will evaluate to a shell subcommand, whose name is FileName.txt
.
What you want is single or double quote:
java ClassName < 'FileName.txt' # 1
java ClassName < "FileName.txt" # 2
java ClassName < FileName.txt # 3
- Single quote disallow expansion (eg: no
'${FILE}'
) - Double quote allow expansion (eg:
"${FILE}"
resolve tofoobar
ifexport FILE=foobar
) - Quote are not needed when the path does not contains specific characters, such as space.
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
add a comment |
You are using the wrong quote:
java ClassName < `FileName.txt`
The ` will evaluate to a shell subcommand, whose name is FileName.txt
.
What you want is single or double quote:
java ClassName < 'FileName.txt' # 1
java ClassName < "FileName.txt" # 2
java ClassName < FileName.txt # 3
- Single quote disallow expansion (eg: no
'${FILE}'
) - Double quote allow expansion (eg:
"${FILE}"
resolve tofoobar
ifexport FILE=foobar
) - Quote are not needed when the path does not contains specific characters, such as space.
You are using the wrong quote:
java ClassName < `FileName.txt`
The ` will evaluate to a shell subcommand, whose name is FileName.txt
.
What you want is single or double quote:
java ClassName < 'FileName.txt' # 1
java ClassName < "FileName.txt" # 2
java ClassName < FileName.txt # 3
- Single quote disallow expansion (eg: no
'${FILE}'
) - Double quote allow expansion (eg:
"${FILE}"
resolve tofoobar
ifexport FILE=foobar
) - Quote are not needed when the path does not contains specific characters, such as space.
answered Dec 29 '18 at 10:49
NoDataFoundNoDataFound
5,7601741
5,7601741
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
add a comment |
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
It works with all three syntax! Solved!
– Bug-Gy
Dec 29 '18 at 11:38
add a comment |
Stack Overflow is a site for programming and development questions. You should use another site on the Stack Exchange network for this question.
– jww
Dec 29 '18 at 23:26