![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Is echo $variable >> text.txt working in MacOSX?
Hi New at this, but want to learn more. I'm trying this as an Shell Command in MacOSX; Code:
newdate='<TIME>' echo $newdate >> /Users/ttadmin/Desktop/test.txt And it don't work. But if I just use; Code:
echo <TIME> >> /Users/ttadmin/Desktop/test.txt (<TIME> is an variable that one program uses.) Hope someone understand the problem.. Best Regards Thomas |
|
|||
|
Thanks for quick replay, but that don't work either. ![]() Code:
newdate='example' echo $newdate >> /Users/ttadmin/Desktop/test.txt This for example just give me one blank file (test.txt). (The <DATE> is an variable that the app I try to use sends out. Other is for example <FILE>, <USER> and so on..) |
|
|||
![]() Ok. It works in the Terminal for me to.. ![]() But not inside the application.. ![]() The app is the FTP-server Rumpus (one Mac-only app). (see attached picture) |
| Bits Awarded / Charged to jackt for this Post | |||
| Date | User | Comment | Amount |
| 11-27-2009 | Neo | Post facts in the first post, not the last! | -10,000 |
|
|||
|
I'm sorry, of course should I get you all every info I have.. Backstory: In the FTP-Server (Rumpus) you can use 'Event Notice' that triggers when someone downloads or uploads some files. And one thing is to use Shell Commands like this (this put the file in a folder that is named after an variable and put some variables in an xml-file in the same folder); Code:
mkdir /<HOMEPATH ANONYMOUS>/<FORMVAR kund> echo '<?xml version="1.0" encoding="ISO-8859-1"?>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '<data>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '\t<kund><FORMVAR kund></kund>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '\t<kundmail><FORMVAR kundmail></kundmail>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '\t<projektledare><FORMVAR projektledare></projektledare>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '\t<filename_arg><FILENAME></filename_arg>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '\t<sidor><FORMVAR sidor></sidor>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '\t<date_arg><DATE></date_arg>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml echo '</data>' >> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml cp <FILE> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME> rm <FILE> This works perfect, but is somehow a bit difficult to overlook and the application don't like this amount of code (to many characters). And I get some input from a friend to use the "$example" to get some better code; Code:
mkdir /<HOMEPATH ANONYMOUS>/<FORMVAR kund> outputfile = '/<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml' echo '<?xml version="1.0" encoding="ISO-8859-1"?>' >> $outputfile echo '<data>' >> $outputfile echo '\t<kund><FORMVAR kund></kund>' >> $outputfile echo '\t<kundmail><FORMVAR kundmail></kundmail>' >> $outputfile echo '\t<projektledare><FORMVAR projektledare></projektledare>' >> $outputfile echo '\t<filename_arg><FILENAME></filename_arg>' >> $outputfile echo '\t<papperkv><FORMVAR papperkv></papperkv>' >> $outputfile echo '\t<sidor><FORMVAR sidor></sidor>' >> $outputfile echo '\t<format><FORMVAR format></format>' >> $outputfile echo '\t<date_arg><DATE></date_arg>' >> $outputfile echo '\t<time_arg><TIME></time_arg>' >> $outputfile echo '\t<note><FORMVAR note></note>' >> $outputfile echo '</data>' >> $outputfile cp <FILE> /<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME> rm <FILE> But this don't work, and it is possible like that Neo is saying that "outputfile = '/<HOMEPATH ANONYMOUS>/<FORMVAR kund>/<FILENAME>.xml'" don't work inside applications (in MacOS X). So my question this time is: Is there some other way to solve this? It feels like the app just use direct commands (like the first example). Thanks Neo for the info, and sorry that I missed all extra info.. Best Regards.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Echo Variables and Text | Grizzly | Shell Programming and Scripting | 3 | 10-04-2009 04:49 PM |
| Echo working funny | hemtar | Shell Programming and Scripting | 8 | 06-23-2009 11:24 AM |
| calling a variable to echo to a log | luma | Shell Programming and Scripting | 1 | 08-17-2007 11:30 PM |
| assigning variable value using echo | shellburger | Shell Programming and Scripting | 2 | 07-11-2005 12:52 PM |
| Display from a variable using echo. | jagannatha | UNIX for Dummies Questions & Answers | 4 | 06-12-2003 04:38 PM |