Need to know how to create self commands in unix.
I want to do some jobs in my unix machine regularly. i want to make a command kind of stuff. Please let me know how to create a command file in unix.
I crated a file in bin directory and used my logic there it works fine like command when i call.
but i want to make that command file not readable format.
like if i view other commands like ls or other things i cannot read the content . i want to do like that.
I think we have to change the mime-type of the command file which i created. Is that right. If so can anybody tell me how to do that?
nathan
January 19, 2007, 7:49am
3
No, I don't think that has anything to do with it actually. Mostly since that doesn't make since to me.
I crated a file in bin directory and used my logic there it works fine like command when i call.
but i want to make that command file not readable format.
like if i view other commands like ls or other things i cannot read the content . i want to do like that.
I assume this means you created a type of shell script, but now you want to make a compiled binary file. You would need to learn C or C++ ( or some other language ) and write the program in that language.
okie you mean we have to write in c and then build the file. there is no way in shell is that what you mean?
nathan
January 21, 2007, 4:50pm
5
Yes, that is what I mean.
Sowser
January 23, 2007, 3:11pm
6
Why do you want to create a binary file as opposed to the shell script version?
-S
My goal is i dont want anybody to edit that file.
Sowser
January 25, 2007, 1:43pm
8
maybe you can just set your permissions....that should prevent anyone (besides root) from even reading your file.
-S
I already did that. But my goal is not editable file.Anyway thanks.
Sowser
January 25, 2007, 2:19pm
10
all you need to do is make it executable. no one will be able to view or write to it...except root.
chmod 111 filename or
chmod 100 filename
good luck with it.
-S
reborg
January 25, 2007, 4:27pm
11
Nor will anyone be able to run it. You need read permission even as the owner to execute a script.
Sowser
January 25, 2007, 6:27pm
12
woops my mistake! i was in a rush!