shell scripts

Login to Reply

Thread Tools Search this Thread
# 1  
Old 07-27-2011

I dont get something about sed

If i have a text file inside contain

sed "s/"$title:$author:$price:$qtyAvailable:$qtySold"/"$Ntitle:$author:$price:$qtyAvailable:$qtySold"/"

This work!!


If i have a text file inside contain
Tom Tom:La La:Di Di :Do Do :De DE

It cannot work =(
sed: -e expression #1, char 7: unterminated `s' command

Last edited by pludi; 07-27-2011 at 10:16 AM..
# 2  
Old 07-27-2011

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums
# 3  
Old 07-28-2011
The spaces within your variables are being interpreted as additional parameters. Use 1 set of quotes around the whole s/// expression:

sed "s/$title:$author:$price:$qtyAvailable:$qtySold/$Ntitle:$author:$price:$qtyAvailable:$qtySold/"

Login to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Two curious questions jamie_123 Shell Programming and Scripting 7 10-03-2012 01:35 PM
Curious about the -9 pflickner UNIX for Dummies Questions & Answers 3 11-17-2010 01:48 AM
Curious MPxIO problem Ranck Solaris 4 09-23-2010 01:23 PM
An curious idea, how to make it by the powerful script? liuzhencc Shell Programming and Scripting 1 02-03-2010 08:24 AM
AWK sub function curious problem under bash Max Rebo UNIX for Advanced & Expert Users 5 11-12-2009 06:24 PM
Curious cron job question Ashberry Shell Programming and Scripting 3 11-11-2009 11:33 AM
Curious & Strange Videos sparcguy What is on Your Mind? 0 12-22-2008 08:33 AM
curious kurosaki Shell Programming and Scripting 6 09-29-2008 10:54 AM
Curious 'ls' Issue vibhor_agarwali UNIX for Advanced & Expert Users 7 07-10-2008 04:19 AM
Curious? River Freight Linux 1 10-07-2007 04:40 PM
Curious Dummy highway39 UNIX for Dummies Questions & Answers 1 08-31-2006 08:22 PM
Curious skotapal UNIX for Dummies Questions & Answers 2 02-28-2003 04:33 PM
Just curious, does Unix stand for anything? pudad UNIX for Dummies Questions & Answers 6 10-18-2002 02:06 AM
All times are GMT -4. The time now is 04:39 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.