So I tried searching using this word
linux execution result redirect
linux shell execution result redirect
linux script redirect
Shell redirect execution result
linux script file redirect
Hmm I think this is the system
This was helpful! Thank you very much!
redirect.sh
#!/bin/bash
echo Execute the created shell file
echo After redirecting the execution result of that file
In other words, this is what I made above.sh file)
$ ./redirect.sh > redirect_redirect.txt
Surprisingly, this kind of content does not appear in the search results. I thought it would come out soon
-[] Isn't there enough research? `` -[X]
No, I did a lot of research`
So I tried it without permission
I was scared to run the file
I didn't understand I wonder if I will understand it soon
By the way, the above result was like this (well, that's right)
$ cat redirect_redirect.txt
Execute the created shell file
After redirecting the execution result
This is what I really wanted to do
redirect_test.sh
#!/bin/bash
echo Execute the created shell file
echo After redirecting the execution result of that file
echo I was able to verify what happened
A shell that handles files with echo cp etc.
If you execute echo and redirect ...
#What if I do this further?
cp redirect_test.sh redirect_test_cp.sh
Redirect the execution result of the above file_redirect_test.Redirect to txt
$ ./redirect_test.sh > redirect_redirect_test.txt
What do you think will happen? Did you think this would happen ↓?
redirect_redirect_test.txt
Execute the created shell file
After redirecting the execution result of that file
I was able to verify what would happen
A shell that handles files with cp etc.
After running and redirecting ...
redirect_test_cp.sh
It became like this ↓
Vim: Warning: Output is not to a terminal
Jeez | No reaction | No longer ... |
---|---|---|
Pien | Pien | Pien |
Vim: Warning: Output is not to a terminal
I checked, exactly the best answer! It feels good
linux sh shell file execute redirect
May this solve the worry
of the person you care about
Recommended Posts