Issue with cat
Hello
I ran into this while training with command line. When I use cat program without arguments, enter a line and press enter it copies said line to next paragraph like this: Code:
$ cat There's been a lot new information for me to handle during last days so I'm not sure if I remember correctly, but this isn't how that buffer is supposed to work by default. I'm using debian stretch at the moment. I don't necessarily need detailed answer, maybe a pointer to a correct log file etc. so I can solve issue myself. Thank you. |
It is working like it should and printing what it has received over to standard output (stdout). What are you trying to do with cat there?
With the way you are invoking it, you can exit with ctrl-d Another way to invoke it would be with a Here Document which goes until it encouters a line starting with some designated text of your choosing: Code:
cat << END-OF-TEXT |
Quote:
My recollection of earlier times probably involved me putting output to some file. There it wouldn't do it the way it did now. But since there is no specified output it just echoes it immediately. Is this correct thinking? |
Quote:
Code:
$ cat > /tmp/cat.log.txt Code:
$ cat << END-OF-TEXT > /tmp/cat.log.txt Code:
man cat |
Quote:
|
Quote:
In general if you approach this like learning any other programming language, it might help. The programs are like functions, more or less. Other good bash resources would be Greg Wooldge's Guide, FAQ, and Pitfalls, as well as his programming guide: https://mywiki.wooledge.org/BashGuide https://mywiki.wooledge.org/BashFAQ https://mywiki.wooledge.org/BashPitfalls https://mywiki.wooledge.org/BashProgramming Speaking of bash, a lot of GNU/Linux users refer to the shell and bash interchangeably but bash is just one shell of several good ones. zsh is another good and advanced shell. In that way it might be useful to try both bash and zsh so you can compare and contrast two advanced shells. POSIX shells like dash are nicer for scripting since they are both more portable and much faster. |
Quote:
I wish I could get into some sort of project to gather more experience but haven't had courage yet to try getting through for example at github. Would be glad to try and spot bugs or anything that would contribute to something... Giving me some new skills in the process of course. :D |
All times are GMT -5. The time now is 01:38 AM. |