As being quite a newbie in linux, I have the follwing question. I have list of files (this time resulting from svn status) and i want to create a script to loop them all and replace tabs with 4 spaces.
So I want from
.... D HTML/templates/t_bla.tpl M HTML/templates/t_list_markt.tpl M HTML/templates/t_vip.tpl M HTML/templates/upsell.tpl M HTML/templates/t_warranty.tpl M HTML/templates/top.tpl A + HTML/templates/t_r1.tpl ....
to something like
for i in <files>; expand -t4;do cp $i /tmp/x;expand -t4 /tmp/x > $i;done;
but I dont know how to do that…
You can use this command:
This will cut the first 8 characters leaving only a list of file names, without Subversion flags. You can also add
grepbeforecutto filter only some type of changes, like/^M/.xargswill pass the list of files as arguments to a given command (lsin this case).