Tag Archives: script

How to Solve Mac installation luajit error

Install luajit today. After downloading the file, run the mak é command and keep reporting this error

tips on the official website:
note for OSX: if the MacOSX_ DEPLOYMENT_ TARGET environment variable is not set, then it’s forced to 10.4.

So the solution: set the environment variable

export MACOSX_DEPLOYMENT_TARGET=10.15

If the error is still reported, it may be that there is no package of 10.15 locally. Replace 10.15 with the version of the cost machine SDK. To see the SDK version of this machine, run the following command:

cd /Library/Developer/CommandLineTools/SDKs

Solve the problem that the native machine cannot use ant script checkout project

Problem Description: the local machine contains SVN command line. If svnsetting svnkit/javahl = true, there will be a conflict with the local SVN command line, resulting in the failure to check out items normally

solution: if both svnsetting svnkit and javahl are false, the program will automatically call native SVN in path.
example: & lt; svnsetting ID=“ svn.setting ” svnkit=”false” javahl=”false” username=”${svn_ user_ name}” password=”${svn_ user_ PWD} “/ &>
extension of the problem: if SVN command line is not installed on this machine, Download svnant and introduce svnkit/javahl jar package into ant/lib, svnkit/javahl corresponds to true

 

Experience of using on error resume next in VBScript

In Vbscript, error handling is done using on Error Resume Next. If you add this sentence to your code, and if any errors occur in other code after this sentence, the system will ignore them and run the rest of the code. In the meantime, we can use the following code to catch errors.

this catches the error code and the description of the error and writes to the log file. However, the problem is that the code after we caught the error, if the error occurs again and you don’t catch it, the code will still ignore the error and continue to run. Ignoring errors is an undesirable result and can make debugging difficult. At this point, the sentence “On Error GoTo 0” can be used to terminate the previous Error handling, that is, it can be paired with “On Error Resume Next”. This will not affect the rest of the code.

has several characteristics to understand,

, 1 on error resume Next if defined in the global, the effect is global, you use this phrase in the main program, the back if the call a function, so if there is an error in the function, also will be ignored, behind the function call statements in your main program can also capture the error, this can be through the following simple code validation:

The result of executing the above code:

13 – type が consistent し ま せ ん.
main ….
As you can see, aaaaaaaaaaa was a deliberate error in the function, followed by wscript.echo “Funcb OK” and the following code were not executed. However, wscript.echo “main…” in the main program The statement is executed. That is, if a statement in a function is wrong, none of the subsequent statements in the function are executed, and the statement following the call to the function is executed directly.
2, On Error Resume Next If defined in the function, see the following code execution

execution results are as follows:
funcb ok
13 – type が consistent し ま せ ん.
13 – type が consistent し ま せ ん.
main ….
It can be seen that this error can be caught in the Err object inside the function and in the main program that calls it. This indicates that the Err object is global, so it should be understood that the scope of err is valid between an On Error Resume Next statement and an On Error Goto 0. If we add an invalid statement after the funcb call statement, the error MSG box will pop up, indicating that the On Error Resume Next in the function body cannot be applied outside of the function.
These are some of the experiences of using On Error Resume Next. If you understand the above two points, you can better use the error handling functions.
http://blog.csdn.net/zmxj/archive/2009/02/24/3932065.aspx
Reference: http://www.meizi.cn/article.asp?id=4
 

syntax error near unexpected token `then’ problem solution

#! /bin/bash
#if program test

echo ‘a:’
read a
If [“$a” = “English”]; then
echo “right”
else
echo “wrong”
fi

I wrote the shell script according to the procedure on the video, but “syntax error near token ‘then'” appeared during the execution. After looking at the syntax error near token’ then’ for half a day, I did not find out the reason. After searching the Internet for a long time, I finally understood the reason: There is no space between if and ‘[‘. In addition, when executing, I also found that there must be space on both sides of’ = ‘, otherwise there will be an error, not a syntax error, but no matter what value is assigned to a, the program will get the statement after if is false, thus resulting in wrong.