Timeline for Redirection to a globbed file name fails
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 28, 2018 at 15:56 | comment | added | Arcticooling | So only find and printf or for and printf will be the best matches here I guess. | |
| Jan 28, 2018 at 15:49 | comment | added | ilkkachu | @pntshere, mm, since the file doesn't exist, the pattern doesn't match anything. It tries to write to /etc/php/*/fpm/zz_overrides.ini (literally), but can't, since /etc/php/*/ (with the literal asterisk) doesn't exist. See my latest edit. | |
| Jan 28, 2018 at 15:45 | comment | added | Arcticooling | Sadly I was wrong, this didn't work: printf "[PHP]\n post_max_size = 200M\n upload_max_filesize = 200M\n cgi.fix_pathinfo = 0" | tee /etc/php/*/fpm/zz_overrides.ini. The error is that no such file or directory exist. Similarly to my original problem, using 7.0 does work... So it seems that even in tee I cannot use wildcards in Bash (Ubuntu server, 16.04, xenial, non-WSL). | |
| Jan 28, 2018 at 0:40 | vote | accept | Arcticooling | ||
| Jan 27, 2018 at 22:31 | history | edited | ilkkachu | CC BY-SA 3.0 | added 775 characters in body |
| Jan 27, 2018 at 20:01 | history | edited | ilkkachu | CC BY-SA 3.0 | added 83 characters in body |
| Jan 27, 2018 at 19:54 | comment | added | Stéphane Chazelas | For bash when non-interactive the behaviour depends on whether the posix mode is enabled or not. ksh88 does the expansion even when non-interactive (which makes it non-POSIX-compliant). Those two shells are the reasons why you also need to quote variables in arguments to redirections, to prevent globs from being expanded (> $file in those doesn't redirect to the file whose path is stored in $file but to the one file that matches the pattern in it if it matches only one file or gives an error otherwise) | |
| Jan 27, 2018 at 19:35 | history | answered | ilkkachu | CC BY-SA 3.0 |