|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Help on shell script question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|