Basically my question is how to use bash shell command to do following automatically, so I can track modified files easily.
- list svn check-out files
- create link files to above files in an directory called “change”
laptop$ svn status -q
M rcms/src/config/ta_show.c
M rcms/src/config/ta_config.c
laptop$ cd change
laptop$ link -s ../rcms/src/config/ta_show.c ta_show.c
laptop$ link -s ../rcms/src/config/ta_config.c ta_config.c
laptop$ ls
lrwxrwxrwx 1 root root 59 Nov 27 12:24 ta_show.c -> ../rcms/src/config/ta_show.c
lrwxrwxrwx 1 root root 59 Nov 27 12:24 ta_config.c -> ../rcms/src/config/ta_config.c
I am thinking to use shell command like below:
$ svn status -q | sed 's/M //' | xargs -I xxx ln -s ***BETWEEN REAL FILE AND BASE FILENAME***
you have two things need to be concerned:
the awk one liner could do it:
so if you pipe your
svn statusoutput to the line above, it print theln -scommand lines for you.if you want the ln -s lines to get executed, you could either pipe the output to sh (
svn status|awk ...|sh) or replace theprintwithsystemat the end i would like to show the output below as an exmple: