![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Predictive text input with Soothsayer | iBot | UNIX and Linux RSS News | 0 | 05-14-2008 01:20 AM |
| Replace text in input file | daphantomica | Shell Programming and Scripting | 2 | 04-25-2008 12:39 AM |
| combining two input text files | d3ck_tm | AIX | 6 | 02-28-2006 08:23 PM |
| How to input username on text file into finger command on shell script | Micz | Shell Programming and Scripting | 3 | 11-07-2005 11:38 PM |
| grep multiple text files in folder into 1 text file? | coppertone | UNIX for Dummies Questions & Answers | 7 | 08-23-2002 11:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
input text into file
hello everyone,
this is my first time posting here so be nice ;-) I am a bit new at unix scripting and have basically been hacking other peoples scripts to get them to do what I need. I have now hit a bit of a stop. This problem is very basic but I can't just seem to figure out how to get around it. And so to the problem. Basically I have an application that can interact with a unix prompt. at any one time it can send one command to the unix and return the output. What I need is to read a few lines of text into a file and for the prompt to return the file name for me. This file will be used at a later point so the file name must be random (pretty random). I was going to use the $$ as the file name. the life of this file will be short but if I use a fixed file name there is a chance it will be used by another process (running the same script at the same time). so basically what I need help with is generating a script file that will take some text in (one or more lines various lenghts) place them in a file and return the file name. If anyone could help me that would be great. Regards Cannon |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
i think the following will do
#!/bin/sh MYFILE=$$ "run your command"> $MYFILE echo "My new file is $MYFILE" Last edited by Kundunni; 12-15-2007 at 07:49 AM. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|