UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 7th, 2006, 12:25 PM
mich_elle mich_elle is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 2 mich_elle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 20 sec
Reputation Power: 0
Bad substitution error :chomp:

Hello all,

I'm using Korn shell and can execute this line with no problem at the command line.


newtest=${gorseve_file//.csv/_log.txt }


gorseve_file = gorseve_8762.csv ( what the var. was)

echo $newtest

gorseve_8762_log.txt

In my script however, I receive a bad substitution error?

Reply With Quote
  #2  
Old August 7th, 2006, 01:39 PM
mich_elle mich_elle is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 2 mich_elle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 20 sec
Reputation Power: 0
This is driving me crazy, been searching around for solution,

Is there another way to set a variable = to a substring

or

I think its some error with the brackets and korn shell??

thx in advance

Reply With Quote
  #3  
Old August 9th, 2006, 09:15 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 2 m 57 sec
Reputation Power: 48
Two things:
If you show the code that fails it is much easier to spot problems.
What you show has errors
Code:
gorseve_file = gorseve_8762.csv

There is a space before the = and after it, for example. But I can't tell if that is in the script.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Bad substitution error :chomp:


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway