Ambiguous Input Redirect Java [closed]












-1















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!










share|improve this 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
















-1















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!










share|improve this 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














-1












-1








-1








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!










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















-1














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



  1. Single quote disallow expansion (eg: no '${FILE}')

  2. Double quote allow expansion (eg: "${FILE}" resolve to foobar if export FILE=foobar)

  3. Quote are not needed when the path does not contains specific characters, such as space.






share|improve this answer
























  • It works with all three syntax! Solved!

    – Bug-Gy
    Dec 29 '18 at 11:38


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














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



  1. Single quote disallow expansion (eg: no '${FILE}')

  2. Double quote allow expansion (eg: "${FILE}" resolve to foobar if export FILE=foobar)

  3. Quote are not needed when the path does not contains specific characters, such as space.






share|improve this answer
























  • It works with all three syntax! Solved!

    – Bug-Gy
    Dec 29 '18 at 11:38
















-1














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



  1. Single quote disallow expansion (eg: no '${FILE}')

  2. Double quote allow expansion (eg: "${FILE}" resolve to foobar if export FILE=foobar)

  3. Quote are not needed when the path does not contains specific characters, such as space.






share|improve this answer
























  • It works with all three syntax! Solved!

    – Bug-Gy
    Dec 29 '18 at 11:38














-1












-1








-1







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



  1. Single quote disallow expansion (eg: no '${FILE}')

  2. Double quote allow expansion (eg: "${FILE}" resolve to foobar if export FILE=foobar)

  3. Quote are not needed when the path does not contains specific characters, such as space.






share|improve this answer













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



  1. Single quote disallow expansion (eg: no '${FILE}')

  2. Double quote allow expansion (eg: "${FILE}" resolve to foobar if export FILE=foobar)

  3. Quote are not needed when the path does not contains specific characters, such as space.







share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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



Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas