Ant Automated remote deployment work notes

Source: Internet
Author: User

11:35:26
Ant has a problem reading files saved in UTF-8 encoding and the files should be saved in Ascii encoding.

14:32:59
: Bad interpreter: No such file or directory indicates that the document is in dos format and needs to be converted to Unix line feed format. This file is written in Windows and its line feed method

It is different from Unix, but it cannot be seen if it is not Set in VI.
Solution:
1. upload to the linux host for running

Chmod + x back

./Back

The error message is as follows:
Bash:./back: bad interpreter: No such file or directory

2. Error Analysis:

Because the operating system is windows and the script is edited in windows, invisible characters may exist.

From the perspective of your script and reported errors, it is likely that your script file is in DOS format, that is, the end of each line is identified by \ r \ n, the ASCII codes are 0x0D and 0x0A.
There are many ways to check whether the file is in DOS or UNIX or MAC format.
(1). vi filename
Run the following command:
: Set ff?
You can see the dos or unix words. if it is in dos format, you can use set ff = unix to force it to unix format, and then save the disk and exit. run it again.
(2). Use joe filename
If it is in DOS format, there will be a lot of green ^ m characters at the end of the line. You can also convert it to Unix format using the above method.
(3). Use OD-T X1 filename
If you see a character like 0d 0a, it is in DOS format. If it is only 0a but not 0d, it is in UNIX format, you can also convert it to Unix format using the above method.

You can use
1. unix2dos or dos2unix are two small programs. It is very simple. In djgpp, the two programs are named dtou and utodd, u stands for UNIX, and D stands for DOS.
2. You can also use a tool like sed:
Sed's/^ m // 'filename> tmp_filename
MV-F tmp_filename filename
Do it
Note: ^ m is not the ^ and letter M generated by SHIFT + 6. It is a character and its ASCII value is 0x0d. to generate it, press Ctrl + V first, then press enter (or Ctrl + M)

In addition, when the shell program reports "command not found", it always checks whether there are any commands used by the program in your path (without specifying the absolute path ).

A small program can be checked in one row.

2009-4-21 15:13:56
XML escaping is sometimes used when shell commands are embedded in sshexec.
And & amp;
Single quotation marks '& apos;
Double quotation marks "& quot;
Yu no.> & gt;
Minor signs <& lt;

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.