SED - Reading Commands From another File--------->>sed -f

 --------------------------------------------------------------------------------------------------
Reading Commands From another File--------->>sed -f <sed file> <file name> 
-----------------------------------------------------------------------------------------------
[prabhucloudxlab@cxln4 prabhu]$ cat > filegrep.txt
unix is great os. unix is opensource. unix is free os.
learn operating system.
Unix linux which one you choose.
uNix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.
ThIs Is LInux 2000
ThIs Is WIndows 3000
ThIs Is MAC 4000
ThIs Is LInux 2000
ThIs Is WIndows 3000



[haritaraka12078@cxln4 ~]$ cat>sedcommands_file
s/LInux/HARI_TARAKA_PRABHU/;
s/WIndows/MANYAM_MANYAM/;




[prabhucloudxlab@cxln4 ~]$ cat>hello.sh
#! /bin/bash
#Example 4: Reading Commands From another File

echo "enter filename to substitute using sed"
read fileName

if [[ -f $fileName ]]
then
sed -f sedcommands_file $fileName
    else
    echo "$fileName doesn't exist"
fi




[prabhucloudxlab@cxln4 ~]$ sh hello.sh
enter filename to substitute using sed
filegrep.txt
unix is great os. unix is opensource. unix is free os.
learn operating system.
Unix linux which one you choose.
uNix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.
ThIs Is HARI_TARAKA_PRABHU 2000
ThIs Is MANYAM_MANYAM 3000
ThIs Is MAC 4000
ThIs Is HARI_TARAKA_PRABHU 2000
ThIs Is MANYAM_MANYAM 3000