The screen displays C:/> xiaotianxia
If you execute C:/> ABC. bat a B
The screen displays C:/> Xiaotian
DOS attaches an empty string to parameter % 3.
You can place not between the IF and condition to indicate if to execute a command when the condition is false.
Note: This command can be directly run under DOS.
IF-ERRORLEVEL
Use NotePad to create a file Xiao. bat with the following content:
@ Echo off
Xcopy C:/autoexec. Bat D :/
If errorlevel = 0 ECH
specify an empty string to the parameter % 3.
2. IF-ERRORLEVEL
Create test4.bat with the following content:
@ Echo off
Xcopy C: // autoexec. Bat D: If errorlevel 1 ECHO file copy failed
If errorlevel 0 ECHO, the file is successfully copied.
Then execute the file:
C: //> test4
If the file is successfully copied, the screen displays "successfully copied file"; otherwise, the screen displays "file copy failed ".
If errorlevel is used to test the return
test whether a file exists. The format is
If exist [path + file name] command
(2) % 1 in the test2.bat file is a parameter. Dos allows passing nine batch parameter information to the batch processing file, which is % 1 ~ % 9 (% 0 indicates the Test2 command itself), which is a bit like the relationship between real parameters and parameters in programming. % 1 is the form parameter, and autoexec. bat is the real parameter.
3) create a file named test3.bat with the following content:
@ Echo off
In maxscript, you can create, delete, and copy files, but cannot delete folders...
I searched online for the batch cut method and called it in maxscript.
FN xcopy oldfile newfile = (newfilepath = newfile + "\" + getfilenamefile oldfile xcopy_cmd = "xcopy/S/e/I/y" + oldfile + "" + newfilepath + " RD/S/Q "+ oldfile doscommand (xcopy_cmd as string) -- print xcopy_cmd) x
contains one row:
For % C in (*. bat *. txt) do type % C
The command line displays the contents of all files with the bat and TXT extensions in the current directory.
Below are a few examples of BAT:
1. If-exist creates a file named test3.bat with the following content:
@ Echo off
If "% 1" = "A" Echo Xiao
If "% 2" = "B" Echo Tian
If "% 3" = "C" Echo Xin
If you run:
C:/> test3 A B C
The screen displays:
Xiao
Tian
Xin
If you run:
C:/> test3 A B
Displayed on the screen
Xiao
Tian
During this comma
the SQL. SQL file and export the data to the/tmp/data file.
# Data tab separation without column names
Cat SQL. SQL | mysql-h hostip-P port-u usernmae-p passwd dbname>/tmp/data
You can use tab to separate data in the import excel file.
# Save the MySQL interaction text to a file
# Save the text output from the mysql client to a file
Mysql> tee/tmp/textdata # Set the file to be saved
Logging to file '/tmp/textdata'
Mysql> select * from user;
Cat/tmp/textdata
In this way, you can see the output t
The following are the current errors. I believe there are still many problems that have not been found in the book. Please promptly raise new errors and I will fix them as soon as possible.
1. P52 page 15th Line Original"Returns the number 0 in the HOOK array."Changed to"Returns the serial number in the HOOK array when the result is successful."
2. Line 3 on page 53Returns the number 0 in the HOOK array."Changed to"Returns the serial number in the HOOK array when the result is successful."
3. Th
attribute. Its Parameters include "+? "And "-? "Two ,"? "Represents the Property Code. These codes are:" H "hidden;" S "system;" R "read-only," + "indicates granting, and"-"indicates removing.
5) xcopy (xcopy. EXE) -- Copy commandThis command is enhanced based on "copy" to copy multiple subdirectories. It has many parameters, but is most commonly used "/s". It can copy multiple subdirectories under a direc
exist
Run:
C: \> TEST2 AUTOEXEC. BAT
The command runs the same result as above.
Note:
(1) if exist is used to test whether a file exists. The format is
If exist [path + file name] command
(2) % 1 in the test2.bat file is a parameter. DOS allows passing nine batch parameter information to the batch processing file, which is % 1 ~ % 9 (% 0 indicates the test2 command itself), which is a bit like the relationship between real parameters and parameters in programming. % 1 is the form parameter, and
) labelmat.append (float ( CURLINE[0])//convert the sequence to matrix Xmat=np.mat (Datamat) Ymat=np.mat (Labelmat). txtx=xmat.t*xmat/determines whether the determinant value is 0ifnp.linalg.det (xTx) ==0.0: print "wrong"//Use the formula to find the parameters ws=xtx.i* (Xmat.t*ymat)//Use matplotlib drawing, developed in Fig fig= Plt.figure () Ax=fig.add_subplot (111) xcopy =xmat.copy () xcopy.sort (0) yhat=xcopy
Recently debugging network communication, each time a little bit of modification, the program from the development machine to copy to the test machine, it is annoying. Since we are the ape, why should be so rigid, can use code to solve the problem, do not use the hand to solve.
First of all, we have no alternative but to copy by hand. At the command prompt, the commands we use to manage files and folders are many, such as rename, DEL, copy for files, MKDIR, RMDIR, and
Installation:1, install IIS (need to accompany the relevant health check, the original default site needs)2. Installing ARR-related files3, after installation, IIS will appear in the server farms node, directly create the server.Site-to-copy (migration):When you need to deploy another IIS site server to share the load, you certainly don't want to copy the folder over and then rebuild the Web site one at a time. Some orders are important at this time.The configuration file that IS7 involves is th
1, DOS Common command detaileddir column file name deltree Delete the directory tree CLS clear Screen CD changes the current directory. Copy copy file diskcopy copying disk del delete file format formatted disk. Edit Text Editing mem view memory status MD Establish subdirectories move files, change directory names. More split screen display type Displays the file contents rd Delete directory
Get the latest code SVN update -- username % svn_user % -- password % svn_password %>"../% LOG_FILE %" Back up Tomcat sitesMD"% App_root % \ backup \ % mvn_profile %-% cur_date %-% myran %">"% LOG_FILE %"Xcopy"% App_root % \ % mvn_profile %" "% App_root % \ backup \ % mvn_profile %-% cur_date %-% myran %"/S>"% LOG_FILE %" Compile code You must call the CMD Cal command L. Otherwise, the maven command will exit the entire bat directly. This problem has
database and import data
# Run the SQL. SQL file, which is generally used for data import.
Mysql-h hostip-P port-u usernmae-p passwd dbname
# Execute SQL to export data to a file
# Execute the SQL statement in the SQL. SQL file and export the data to the/tmp/data file.
# Data tab separation without column names
Cat SQL. SQL | mysql-h hostip-P port-u usernmae-p passwd dbname>/tmp/data
You can use tab to separate data in the import excel file.
# Save the MySQL interaction text to a file
# Save t
and DOS allows 9 batches of parameter information to be passed to the batch file,%1~%9 (% 0 for the test2 command itself), which is somewhat like the relationship between actual and formal parameters in programming,%1 is a formal parameter, AUTOEXEC. BAT is an argument.
3 Further, establish a document called Test3.bat, which reads as follows:
@echo off
IF "%1" = = "A" ECHO XIAO
IF "%2" = = "B" ECHO TIAN
IF "%3" = = "C" ECHO Xin
If you are running:
C:\>test3 A B C
The screen will show:
XIAO
TI
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.