In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Variable operation: view: set define variable: set val=abc prompt for variable: set / p val= Please enter variable: val replacement: set val=%val:a=b% # replace an in variable% val% with b intercept: set val=%val:~0,3% # intercept the first three digits of val: set val=%a%%b% calculation: set / an a=%b%+1 # sets the value of variable a to variable broom1 call statement: A.batb.bat# calls b.bat in a.bat: direct call: call b.bat pass parameter: call b.bat% 1% 2... call b.bat% * abbreviation: @ b.bat View script directory: echo% ~ dp0 judgment statement:
a. Syntax: if condition (logic) else (logic)
b. Conditions:
Determine whether the string is equal: "string 1" = "string 2" to determine whether the value is equal: value 1 equ value 2 to determine whether the file / folder exists; exist file name to determine whether the variable is defined; defined variable to determine whether the return value of the previous statement:% errorlevel% # is 0 successful, otherwise execution failed
c. Expression:
English interpretation of the meaning relation equals to equ equal greater than gtr greater than greater than or equal to geq greater than or equal less than lss less than less than or equal to leq less than or equal is not equal to neq no equal loop statement:
a. Syntax: for% an in (% b%) do (logical)
b. Usage:
Traverses all files in the current directory: for% I in (*) do (echo% I) traverses all parameters in the script: for% I in (% *%) do (echo% I) output text, separated by the second paragraph: for / f "delims= Tokens=2 "% I in (test.txt) do (echo% I) traverses all folders in the current directory: for / d% I in (*) do (echo% I) recursively traverses all files in the current directory (including subdirectories): for / r% I in (*) do (echo% I) set up sequence: for / l% I in (1p2) 5) do (echo%% I) output: 135character set Operation: view: chcp switch: chcp 936 # simplified Chinese chcp 65001 # utf-8 clear screen: cls display / modification time, Date: date: date time: time only shows: date / t Macro Action (alias): create: doskey lee=cd e:\ test $t dir # $t is the delimiter use: lee View History: doskey / history set History Save number: doskey / histsize=1 exit script: exit / b status code View help document: dir /? help dir jump statement: create tag:: label jump to tag: goto Label endless loop:: testecho testgoto test logout: logoff # linux is the execution of the logout suspension program: pause print operation: display print list: print delete specified file: print / c test.txt append print file: print / p test.txt empty: print / t modify dos window prompt: prompt $psigg sort: positive order: sort test.txt reverse order: sort / r test.txt input sort: sort # end press ctl+z+ Enter display dos version number: ver display disk volume label and serial number: vol scan disk: scan now: sfc / scannow boot automatic scan: sfc / scanboot
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.