Skip to main content
12 events
when toggle format what by license comment
Jan 27, 2018 at 18:22 comment added ilkkachu @pntshere, cat just opens all files listed on its command line, reads them, and writes them to its standard output. It doesn't open any files for writing itself. An output redirection makes the shell create them if necessary. That also happens without cat: you could write true > some.file and the file is created. The concatenation bit comes if you give more than one input for cat. It doesn't separate them in its output, so you get a concatenation. but with just one input, there's really nothing to concatenate.
Jan 27, 2018 at 18:08 vote accept Arcticooling
Jan 27, 2018 at 13:32 answer added ilkkachu timeline score: 4
Jan 27, 2018 at 12:42 answer added Bach Lien timeline score: 2
Jan 27, 2018 at 9:00 comment added Arcticooling How will you define what cat does? If it was bash instead cache the code was executed but what cat is "concatenating" in this particular case? Only the streams one to another?
Jan 27, 2018 at 5:25 comment added Wildcard Note that cat doesn't create files either. The redirection that you use creates the file.
Jan 27, 2018 at 3:44 comment added Arcticooling Oh, sure, I didn't think of that, I'm quite new to redirections and I need to internalize this concept better. Thanks!
Jan 27, 2018 at 3:43 comment added steeldriver Huh? you can redirect the printf output to a file (which will create it if it doesn't exist)
Jan 27, 2018 at 3:42 history edited Arcticooling CC BY-SA 3.0
added 12 characters in body
Jan 27, 2018 at 3:40 comment added Arcticooling I used heredocument/herestring to create the file on the way, but touch + && may be handy, because AFAIK, one cannot create a file with printf.
Jan 27, 2018 at 1:31 comment added steeldriver Um, I may be misunderstanding here - but can't you just use printf? e.g. printf ' [PHP]\n post_max_size = 200M\n upload_max_filesize = 200M\n cgi.fix_pathinfo = 0\n'
Jan 27, 2018 at 1:14 history asked Arcticooling CC BY-SA 3.0