linux - Reading From Standard Input In Bash Programming -
I am programming a programming program for Uni and everything is working, except for the Automark software (which is the blackbox ), I have contacted one of my unitary lecturers and they said that:
"There is some confusion about what" reading "with the standard input means that it You read from your keyboard's keyboard, not from the terminal command line .... this error part It is also in histoplate (program I'm talking about here) "
Now I do not have any idea what it means. I have seen everything on the internet, and I thought my code is reading with standard input
Is not it what "lith line" does? My program receives data and converts it to histoplate, which looks like this:
1 1 2 3 3 2 4 1 And it Converts this to:
1 # 2 ### 3 ## 4 # This is my code (sorry enough): < / P>
#! / Bin / bash addWordcount = 0 customHash = 0 customHashchoice = "#" scale = 0 in $ i, then add [[$ i = "-c"]] then addDirect = 1 elif [[$ i = "-p"] ] Then customHash = 1 elif [[$ i = "-s"]] then scale = 1 x $ * is done for x if [-f $ x]; Then when reading the line, the line AMMT = $ {line% *} hash for NO = $ {line ## *} ((i = 0; i & lt; hash no; i ++)) hash = "#" #hashNumber = $ (expr $ hashNumber) - 1) Printed "% 3s" $ lineAntent if [[$ $ addWordcount -q 1]] then the printf "% 5s" $ is not hash printf "$ hash \ n" Hash = "" done and lieutenant; $ X fi
while reading Stdin, But you have used a redirection. Read the line while typing ; Do ... done & lt; $ X , you are making the filename in $ x of , while reading your bid script instead of reading stdin. That is, the studin of that script is not the same as the stdin of the same loop Just leave the redirection.
Comments
Post a Comment