SunQuest
           Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 20th, 2004, 10:21 AM
bjr149xxx bjr149xxx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 bjr149xxx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help on shell script question

ok im trying to write a string to a file. dont want to append it, and the string cannot come from another file so its basically....

string>file

everytime you put a new string it has to rewrite over the file hence the > instead of the >>...

am i using the wrong command or something?? because i cannot figure it out!


i tried using every cat and exec command possible, i figured out sorta one way but i cannot close the cat!

i had....

mystring="BLAHBLAH"
cat > outfile
$MYSTRING
???????

But now i dont know how to close it from within a shell scropt. i know its control - d if you type it from the prompt but from inside a bash script i have no idea... any help appreciated thanks

Reply With Quote
  #2  
Old November 3rd, 2004, 06:12 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 49 m 57 sec
Reputation Power: 9
1) *nix is case sensitive, aaa and AAA are not the same
2) you are trying to use a 'here-document' the syntax is
cmd >output << stopflag
exemple:
cat >xxx <<STOPME
aaaaa
bbbbb
ccccc
STOPME
3) why not simply: echo $XXX >xxx

Last edited by guggach : November 3rd, 2004 at 06:13 AM. Reason: typo

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Help on shell script question


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 5 hosted by Hostway