Skip to main content
added 221 characters in body
Source Link
Shawn J. Goff
  • 47.2k
  • 27
  • 138
  • 148

You can express those conditions using regular expressions and use grepgrep to filter the results based on those.

The first one is ^?. The carat is a special character that represents the beginning of a line; so that expression matches the beginning of the line immediately followed by a ?.

The second one is ^ *\*. The * is a special character that qualifies the preceding character - it means the preceding character may appear zero or more times. Since * is a special character, the one you're looking for needs to be escaped, hence, \*. So that expression will match the beginning of a line followed by zero or more spaces, followed by an asterisk.

For your first condition, use the -v option for grep to negate the results.

So finally,

svn status --show-updates | grep -v '^?'

or

svn status --show-updates | grep '^ *\*'

Regular expressions are very powerful, so many Unix tools can use them. They are very much worth learning. There is a great tutorial at regular-expressions.info.

You can express those conditions using regular expressions and use grep to filter the results based on those.

The first one is ^?. The carat is a special character that represents the beginning of a line; so that expression matches the beginning of the line immediately followed by a ?.

The second one is ^ *\*. The * is a special character that qualifies the preceding character - it means the preceding character may appear zero or more times. Since * is a special character, the one you're looking for needs to be escaped, hence, \*. So that expression will match the beginning of a line followed by zero or more spaces, followed by an asterisk.

For your first condition, use the -v option for grep to negate the results.

So finally,

svn status --show-updates | grep -v '^?'

or

svn status --show-updates | grep '^ *\*'

You can express those conditions using regular expressions and use grep to filter the results based on those.

The first one is ^?. The carat is a special character that represents the beginning of a line; so that expression matches the beginning of the line immediately followed by a ?.

The second one is ^ *\*. The * is a special character that qualifies the preceding character - it means the preceding character may appear zero or more times. Since * is a special character, the one you're looking for needs to be escaped, hence, \*. So that expression will match the beginning of a line followed by zero or more spaces, followed by an asterisk.

For your first condition, use the -v option for grep to negate the results.

So finally,

svn status --show-updates | grep -v '^?'

or

svn status --show-updates | grep '^ *\*'

Regular expressions are very powerful, so many Unix tools can use them. They are very much worth learning. There is a great tutorial at regular-expressions.info.

Source Link
Shawn J. Goff
  • 47.2k
  • 27
  • 138
  • 148

You can express those conditions using regular expressions and use grep to filter the results based on those.

The first one is ^?. The carat is a special character that represents the beginning of a line; so that expression matches the beginning of the line immediately followed by a ?.

The second one is ^ *\*. The * is a special character that qualifies the preceding character - it means the preceding character may appear zero or more times. Since * is a special character, the one you're looking for needs to be escaped, hence, \*. So that expression will match the beginning of a line followed by zero or more spaces, followed by an asterisk.

For your first condition, use the -v option for grep to negate the results.

So finally,

svn status --show-updates | grep -v '^?'

or

svn status --show-updates | grep '^ *\*'