How to deal with shell scripts that can implement two functions-php Tutorial

Source: Internet
Author: User
The shell script that can implement two functions finds that linux doesn't understand shell, just like war won't use a gun. Just learned. You can stick out scripts that you think are commonly used. The more elementary the better! I now have two lines in the file that need to be resolved 1. When sending code on the forum, you may sometimes write a row number, such as 1 & lt ;? Php2echo & quot; hello & quot; 3? & Gt; how to configure the 2shell color scheme for 1, 2, 3 is to find a shell script that can implement two functions
It is discovered that linux does not understand shell, just as it does not know how to fight. Just learned. You can stick out scripts that you think are commonly used. The more elementary the better! I have two problems to solve.
1. go to the row number in the file. When sending code on the forum, you may sometimes write the row number, as shown in figure
1 2 echo "hello ";
3?>
How can I get 1, 2, 3?


2shell color scheme
Is how to modify. bashrc to make the terminal display clearer

You can only post within 100. How can this problem be solved !!! I don't want to add more points. CSDN is not allowed.

------ Solution --------------------
Try this (first)
Sed's/^ [0-9] * \ s // g' filename



Second unfamiliar
------ Solution --------------------
What editor do you use? The file line number is generally canceled and displayed through the attribute settings of the editor.
------ Solution --------------------
To answer the first question, test.txt is the source file, and the file name stored after result.txt is processed:

[[Email protected] scripts] $ cat test.txt
1 2 echo "hello ";
3?>
[[Email protected] scripts] $ cut-c3-test.txt> result.txt
[[Email protected] scripts] $ cat result.txt
Echo "hello ";
?>
[[Email protected] scripts] $
------ Solution --------------------
Positive solution on the second floor
To way830906 if the number is 2-digit, 3-digit, 4-digit, are you satisfied?

------ Solution --------------------
Help top ·~~~~~~~~~~ "'

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.