1 year ago

#312900

test-img

user1874594

AIX Shell Prepend code being run to an output logfile along with stdout data

How do I prepend the code I ran, either directly at the shell prompt or via shell-script to an output logfile I created.

#something like this 
echo ' Until < code > do ; <code> done; case       <code> esac ; ' >> op.log ;
Until < code > do ; <code> done; case       <code> esac ; | tee -a op.log

Instead of crafting an echo statement I'd like to know if its poss through a 'cody' approach to capture whatever you just ran and stick that in your log file, ( at the beginning ) so when I open that log - I 'll know what code produced this . It should be a one time prepend as against repeating with every loop iteration.

loops

shell

unix

scripting

tee

0 Answers

Your Answer

Accepted video resources