Share One: Command for batch adding files in svn in Linux

Source: Internet
Author: User
An occasional opportunity to officially start using ubuntu at work, although I have used ubuntu occasionally before, I have never officially used it. Next, the file comes. install various software and many familiar Ides won't work.

Svn status | grep "? "| Awk '{print $2}' | while read line; do svn add $ {line}; done;


The principle is relatively simple. it mainly uses redirection and combines some basic commands.

Svn status-- This command is used to view the file information. M indicates modification ,? Unknown (that is, the file to be added)

Grep "? "-- Search for include? Information

Redirects the svn status result to grep "? "The result is to add a file.

Next we use awk to process the string. awk '{print $2}' indicates printing the second data, where $0 indicates the whole row of data.

Svn status | grep "? "| Awk '{print $2}'The result is the file name, and then it is processed cyclically using shell.

While read line; do svn add $ {line}; done;-- Read each row of data and execute svn add


An occasional opportunity to officially start using ubuntu at work, although I have used ubuntu occasionally before, I have never officially used it. Next, the file comes, installing various software, and many familiar Ides won't work. The most miserable thing is to submit code, especially to add a file. it is too troublesome to add only one file at the beginning. The most coder, this kind of thing is absolutely intolerable, so ....

Related Article

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.