Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:38:17+00:00 2026-06-11T19:38:17+00:00

I find the best solution for my problem here: Howto fix subversion «!» status

  • 0

I find the best solution for my problem here: Howto fix subversion «!» status

But now, I just wish to write a small script to do that.

Like this:

svn status | grep '\!' | awk '{print $2}' | xargs svn revert

svn status | grep '\!' | awk '{print $2}' | xargs svn delete

But in one line.

Because, after the svn revert, “svn status | grep ‘!'” return no results. Rational.

I think that I found a solution: Putting the data passed to xargs twice in one line but I’m little rusty in English and command line isn’t my strong skills.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:38:18+00:00Added an answer on June 11, 2026 at 7:38 pm
    svn status | grep '\!' | awk '{print $2}' | tee list.$$ | xargs svn revert
    xargs svn delete < list.$$
    rm list.$$
    

    The tee command is like a T pipe fitting; one copy of the output goes to each named file and another to standard output. Here, I’ve named just one file. This forces all the reverts to happen before any of the deletes.The name list.$$ is a simple way of protecting the script from trampling on the files of other processes; there are programs like mktemp that can be used to create more secure, less predictable names. OTOH, if you aren’t running in hostile environments, it is unlikely to matter. If you’re being really careful, you’ll create a trap to ensure the file is cleaned up:

    tmp=${TMPDIR:-/tmp}/list.$$
    trap "rm -f $tmp; exit 1" 0 1 2 3 13 15
    
    svn status | grep '\!' | awk '{print $2}' | tee $tmp | xargs svn revert
    xargs svn delete < $tmp
    
    rm $tmp
    trap 0
    

    There are other tricks that could be tried, but at least some of them don’t guarantee the sequential operation. For example, process substitution in bash:

    svn status | grep '\!' | awk '{print $2}' | tee >(xargs svn revert) | xargs svn delete
    

    Each file will be both reverted and deleted, but the sequencing is not predictable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find the best solution: I have a usermodel and the user
I've tried my best to find out a solution with the many script questions
My problem is to find best view configuration for my application that have a
I really got tired of this problem and can't find a best practice for
We're come across a problem here at my company and I'm trying to find
Actually I don't know how to find solution to this problem and how to
Here's my situation, and it's probably fairly common but I have yet to find
I've been unable to find an adequate solution to this problem, so any help
Trying to find the best way of create an overlap/overlay layer to fill the
I am trying to find the best way to implement Model using Zend Framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.