#!/bin/csh 

# This program demonstrates the difference between
# single and double quotes

echo "Pattern you want to replace:"
set replace = "`head -1`"
echo "Replace : $replace"
echo "Pattern you want to replace with:"
set with = "`head -1`"

echo "OUTPUT 1"
echo "--------"

# Outer single quotes after / prevents the shell from causing expansion.
# The inner double quotes allows the shell script to 
# put the actual value of the variable.

sed 's/'"$replace"'/'"$with"'/' file1

#############################################################

# the single quote does not allow the shell to expand anything
# inside it. 

echo "OUTPUT 2"
echo "--------"

sed 's/'$replace'/'$with'/' file1

#############################################################

# replaces the word $replace with the word $with

echo "OUTPUT 3"
echo "--------"

sed 's/$replace/$with/' file1


