[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Logging of commands in a bash script to a file



Hi, Adam.

On Tuesday, 22 April 2014 18:40:19 -0500,
K. Adam Wolfe wrote:

> Use redirects:
> 
> $IP route add ${VPN_NET[$N]} dev ${VPN_IFACE[$N]} src ${VPN_IP[$N]} table $N >> /some/log/file
> $IP route add default via ${VPN_GW[$N]} table $N >> /some/log/file
> 
> 
> $IP route add ${VPN_NET[$N]} dev ${VPN_IFACE[$N]} src ${VPN_IP[$N]} >> /some/log/file
> 
> $IP rule add from ${VPN_IP[$N]} table $N >> /some/log/file
> 
> That will place the output of those commands (and only those commands) into /some/log/file.
> Just make sure you have write permissions to wherever you are redirecting

I want to send the commands itself to a file instead of the output
generated by the commands.

In fact, in the four cases mentioned above, if these are executed
successfully, it does not produce any output.


Thanks for responding.


Regards,
Daniel
-- 
Ing. Daniel Bareiro - GNU/Linux registered user #188.598
Proudly running Debian GNU/Linux with uptime:
21:07:07 up 75 days, 23:33, 18 users,  load average: 1,23, 1,16, 1,11

Attachment: signature.asc
Description: Digital signature


Reply to: