180626
Windows 10 Pro - 1809
for聽/r聽%i聽in聽(*.log)聽do聽(break聽> %i)
This command runs without problems in cmder, but when I try to add an alias to it, it gives me this error.
The command finds all *.log files in the folder and clears them with > break.
I've tried with quotes, without, with double % , without.... nothing seems to work for this alias.
位 alias clear_logs=for /r %%i in (*.log) do (break > %%i)
do was unexpected at this time.
@szabizs At first glance Your alias syntax is incirrect. Search for doskey in google and look at the microsoft docs
@szabizs At first glance Your alias syntax is incirrect. Search for doskey in google and look at the microsoft docs
It is correct, this script does run.
for /r %i in (*.log) do (break > %i)
位 for /r %i in ("*.log") do (break > %i)
(break 1>C:\_programming\php\comercial_upgrade\comercial_upgrade\storage\logs\laravel-2019-09-27.log )
(break 1>C:\_programming\php\comercial_upgrade\comercial_upgrade\storage\logs\laravel-2019-10-01.log )
(break 1>C:\_programming\php\comercial_upgrade\comercial_upgrade\storage\logs\laravel-2019-10-02.log )
No its not. It might be correct dos batch but it is not correct doskey because of the special characters like '>'. Look at the doskey docs as Irecommended and cmder aliases wiki
Pay attention to the cmder aloas command lin syntax on escaping '%' also.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contribution(s).
Most helpful comment
Pay attention to the cmder aloas command lin syntax on escaping '%' also.