13

Working with file-names

view full story
linux-howto

http://www.unix.com – Hello forum, I am new to shellscripting. My first goal is to write a script that verifies that for each file in one path there is an associated one in another path. The association is deviated by a distinct 'part' of the filename(s). Therefore I wanted to work with substitution. Here is what I have so far: Code: for i in /my/source/path/*  do   var=basename $i   echo ${var//cutme/""}  done I expected to put every filename reduced by the string 'cutme' to stdout. But it will tell me it has not sufficient privileges. I think it tries to rename the actual f (HowTos)