Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to simulate script execution?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
edgardo88
Posts: 8
Joined: 2015-04-17 00:10

How to simulate script execution?

#1 Post by edgardo88 »

I'm trying to save the output of the script I wanna run but for some reason I cant manage to do it with "script.sh > Output_4.txt"
The thing is that the script was already run and it extracted some directories so when I try to run it again (to save the log to a Output_4.txt) bash says (see screen-capture) and of course the log's empty!!!!

Image


Thx in adavanced!!!!!

Code: Select all

Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux

At least for now...

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: How to simulate script execution?

#2 Post by kiyop »

Post the concrete contents of the script.
I think that you should add some command to check if the output file exist or not. You can use parameter to the script instead of redirection.
But I cannot explain it in English well.
If you post the contents of the script, I can write better one.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1400
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 79 times
Been thanked: 175 times

Re: How to simulate script execution?

#3 Post by steve_v »

My solution would be to use a "logger" type function within the script, with a switch for "debug mode" that logs to a file. But it really depends on what you are trying to do.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Post Reply