Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I have a script that scan files, find old templet and replace it with new one.#!/bin/ksh
file_name=$1
old_templet=$2
new_templet=$3# Loop through every file like this
for file in file_name
do
cat $file | sed "s/old_templet/new_templet/g" > $file.new
#do a global searce and replace and put the results
mv $file.new $file
#rename $file.new to original name of file
done
How can I replace the old templet with few rows templet ?
for example:
the old templet =
xxxx
the new templet =
yyyy
zzzz<script_name> <file_name> xxxx yyyy??zzzz
What has to be instead the ?? in order to split the yyyy and zzzz for tow separate rows ?
10x
Amir

![]() |
reading colon delimited d...
|
help file system watcher ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |