The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-17-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
Hi

This is the same question you posted in:

Need help regarding replacing a part of string

Please folow the forum rules and do not multiple post....

however...following examples should help you on your way a little:


Code:
#  mainstr="abacus sabre"
#  echo $mainstr
abacus sabre

#  echo $mainstr | sed 's/ab/cd/g'
cdacus scdre
#  echo $mainstr
abacus sabre

#  mainstr=`echo $mainstr  | sed 's/ab/cd/g'`
#  echo $mainstr
cdacus scdre