| | |
How to generate a temp file until finish selected then replace to another file.
![]() |
•
•
Join Date: Feb 2006
Posts: 399
Reputation:
Solved Threads: 14
Re: How to generate a temp file until finish selected then replace to another file.
0
#2 Nov 6th, 2008
Ot create a file and pipe something into it whatever you like you can use the redirect to a file
This will open a new file or overwrite an existing file in the same location and then put the text hello into /tmp/temp.txt. If you want to add addtional lines use the following command
You file will then contain hello followed by hello chris to move this file from one location to the other use the following code
Shell Scripting Syntax (Toggle Plain Text)
echo "hello" > /tmp/temp.txt
Shell Scripting Syntax (Toggle Plain Text)
echo "hello chris" >> /tmp/temp.txt
Shell Scripting Syntax (Toggle Plain Text)
mv location1 location2 e.g mv /tmp/temp.txt /tmp/finished.txt
If my post helped add to my rep!
•
•
Join Date: Nov 2008
Posts: 2
Reputation:
Solved Threads: 0
Re: How to generate a temp file until finish selected then replace to another file.
0
#3 Nov 7th, 2008
Re: How to generate a temp file until finish selected then replace to another file.
0
#4 Nov 7th, 2008
Do you use the temporary file for anything in the meantime? I'm biased against temporary files when they can be avoided, personally... Why not stuff it all into a variable and then stuff it into a file when it's done, or just write directly to the destination file? Here's an example of using a variable:
Hope that helps!
Shell Scripting Syntax (Toggle Plain Text)
## the quotes are important! RESULT="$(command --switches)" echo "$RESULT" > /tmp/finished.txt
Hope that helps!
![]() |
Similar Threads
- Unable to remove Virus Alert, Pop Ups & IE Start Up page .. help ... (Viruses, Spyware and other Nasties)
Other Threads in the Shell Scripting Forum
- Previous Thread: How to check my conditions....!!!
- Next Thread: My own shell-wannabe
| Thread Tools | Search this Thread |





