中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-15 11:35
47,813 topics / 349,903 posts / today 1 new / 48,257 members
DOS疑难解答 & 问题讨论 (解答室) » [Help] Please tell me the usage of [] and $ in bat
Printable Version  2,218 / 4
Floor1 foxandmonkey Posted 2005-04-14 00:00
初级用户 Posts 23 Credits 129
Often see the sentence `if == goto %2` written at the beginning of a batch script. What does it mean? What does `$` represent?
Floor2 willsort Posted 2005-04-14 00:00
元老会员 Posts 1,512 Credits 4,432
Re foxandmonkey: "Often"?! Only my program would have such a usage. If you had read all the programs I wrote here, you wouldn't have this question. This statement is mainly to assist in achieving the modularization you mentioned, similar to the CALL :lable usage under the NT command line. It means that if the first parameter is $, then the second parameter is taken as the label of the specified module and jumps to there. is similar to "%1", I call it "air defense character" because it is to prevent %1 from being empty and causing a syntax error in the if statement. Also, $ and are quasi-keywords often used in my early programs. They are defined by us program designers. Of course, for the uniformity of style and readability of the program, such usage has become my habit. However, now I am considering making some changes in style, such as changing to "" which is used more commonly by more people, and $ to : and so on, because my programming platform has changed a lot.
Floor3 foxandmonkey Posted 2005-04-14 00:00
初级用户 Posts 23 Credits 129
Brother willsort, PFPF.
I've collected all your programs. Since I came to the forum yesterday, I've been reading them. Good programs are as enjoyable to read as good articles, bringing a feeling of great satisfaction.
In the past, I only dabbled in writing bat files, never a systematic one. Yours are several versions, each improved and full of highlights, making me clap in admiration, ponder deeply, and even forget about food
Floor4 defrag Posted 2005-04-24 00:00
中级用户 Posts 570 Credits 456
WillSoft you... ah
Floor5 qqqrun3 Posted 2010-11-13 18:04
初级用户 Posts 28 Credits 59
Thank you for lighting torches for people in the dark!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023