<p>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.</p>

<p>So I want from </p>

<pre><code>....
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
....
</code></pre>

<p>to something like</p>

<pre><code>for i in &lt;files&gt;; expand -t4;do cp $i /tmp/x;expand -t4 /tmp/x &gt; $i;done;
</code></pre>

<p>but I dont know how to do that...</p>

I would use sed, like so:
```
```
for i in files
do
    sed -i 's/\t/    /' "$i"
done
```
```
That big block in there is four spaces. ;-)
I haven't tested that, but it
should
work.  And I'd back up your files just in case.  The -i flag means that it will do the replacements on the files in-place, but if it messes up, you'll want to be able to restore them.
This assumes that $files contains the filenames.  However, you can also use Adam's approach at grabbing the filenames, just use the sed command above without the "$i".