Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hide my awk script

Status
Not open for further replies.

ahlim2

Programmer
Aug 5, 2001
1
MY
Hi !
Hopefully someone in this forum can suggest something here. How do I hide my awk script file in UNIX from being mess around. I have tried to change the access mode but they can print the awk script files and see the code. >:-< I will say that what I intend to do here is to protect my Intelectual Property. Somebody always tried to steal my hardship and gain from what not theirs. %-( I don't mind sharing knowledge but it will be beautiful if they request it politely.
Thanks, hopefully someone out there know how to do this on awk code or merely like C code which we can have an executables. :-I
 

Hi ahlim2!

It's easy sometimes to work with machines, but very hard to work with people, I think. People are sinners, like Bible says; they make things wrong, like Murphy says.

I have a suggestion for you. You can generate your script from another awk script or from C-executable programm and run it just in time.

Suppose that your secret awk script is

BEGIN { FS = &quot;,&quot; }
{ print $1, $2 }


You can generate it with this awk script:

BEGIN {
print &quot;BEGIN { FS = \&quot;,\&quot; }&quot; > &quot;prog.awk&quot;
print &quot;{ print $1, $2 }&quot; >> &quot;prog.awk&quot;

system(&quot;awk -f prog.awk list.csv&quot;)
}


Yes, other peoptle can access this script, but this thing hides littlebit your code. A better way is to generate awk script from C-program and run it just in time.

I hope this helps.

Bye!

KP.

 
Surely if you change the permissions to 600 (-rw-------), they won't be able to view or print the script?

Greg.
 
How bout chmod 500 awkscript.

If you have users running around with root privileges then you don't have a prayer of
keeping anything away from prying eyes.

You could exec the script from another script
or run it from a shell function.

#!/bin/sh
#shell function to call awk script with #getopts type options.
awk_init() {
_op=$1

case $_op in

-v) awkscript -v ;;

-s) awkscript -s ;;

esac
}

Hope you get the idea. This is a little safer than wrapping the awkscript-you could source this from a .profile or shell init file on
login.

Going off the deep end you could write an
expect script to pw protect and encrypt
the awkscript....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top