Cmder: alias register issue

Created on 1 Oct 2019  路  5Comments  路  Source: cmderdev/cmder

Purpose of the issue

  • [X] Bug report (encountered problems/errors)
  • [ ] Feature request (request for new functionality)
  • [ ] Question

Version Information

180626

Windows 10 Pro - 1809

Description of the issue

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.
馃憖 Awaiting Response

Most helpful comment

Pay attention to the cmder aloas command lin syntax on escaping '%' also.

All 5 comments

@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).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hyrious picture hyrious  路  3Comments

GlassGruber picture GlassGruber  路  3Comments

tfarina picture tfarina  路  3Comments

isnullxbh picture isnullxbh  路  3Comments

danwellman picture danwellman  路  3Comments