Ecsuse the noise folks. To clear up any confusion...
In a hurry the last few days & I named a function I wrote after an
exsisting hash named dbj2. Bad idea on my part, so please allow me
to own my mistake & take full responsibilty. The code has been
renamed to "mHash" (using Camel case) meaning "Mike's Hash".
mHash info here:
https://porkchop.neocities.org/notes/mHash.txt
Glad you changed your mind.
Nah dbj2...
I use ZOC: https://www.emtec.com/zoc/index.html
Wow! Haven't heard anything about ZOC in decades. Does it still exist?
In what form? What has it evolved into?
(Just out of curiosity, why *did* you mention it here?)
Note: I used ZOC way back when in OS/2 days - for serial comms only.
Nobody uses serial anymore (and if they did, all you need is screen(1)),
so is there any point in ZOC anymore?
Note; I really liked it - back in OS/2 days, so don't take any of this as slagging it or as negativity.
Example csv file (we'll choose sally, her hash is
the number directly below in the same column):
# jenny, sally, wendy
4044119583, 156734252, 0782926302
apple, she, pear
these, knows, another
fubar, how, blurb
Example commandline invocation:
awk -vNAME=sally -vKEY=2147483647 -f script.awk data.csv
Example script, we'll constrain processing *exclusively* to sally's column
BEGIN {
FS = "," # set field separator to comma
UNLOCK = 0 # when > 0, column is 'unlocked'
HASH = mHash(NAME, KEY) # initialize hash & lets go...
}
NR == 3 { # start @ 3rd line
for (x = 1; x <= NF; x++) {
if ($x ~ HASH) {
UNLOCK = x;
break;
}
}
}
NR > 3 && UNLOCK {print $UNLOCK} # if unlocked, print only sally's column
As presented, this is just a complex way of selecting a column so there
must be some context you are considering that provides the actual
security because, as it stands, anyone who can run that awk command can
run a much simpler one to look at any data they like. How do you think
this would be used?
Oh yeah, simply plugin: '156734252'
One thing I do wonder about is wheather or not
this is valid under Windows:
if (y < 1) print "error" > "/dev/stderr"
In Windows, its simply 'nul' in the current directory.
Mike Sanders <porkchop@invalid.foo> wrote:
One thing I do wonder about is wheather or not
this is valid under Windows:
if (y < 1) print "error" > "/dev/stderr"
In Windows, its simply 'nul' in the current directory.
No not 'nul' (got ahead of myself), rather:
stdin: 0
stdout: 1
stderr: 2
Still using /dev under Windows seems odd.
Mike Sanders <porkchop@invalid.foo> wrote:
Mike Sanders <porkchop@invalid.foo> wrote:
One thing I do wonder about is wheather or not
this is valid under Windows:
if (y < 1) print "error" > "/dev/stderr"
In Windows, its simply 'nul' in the current directory.
No not 'nul' (got ahead of myself), rather:
stdin: 0
stdout: 1
stderr: 2
Still using /dev under Windows seems odd.
This works, but feels like a hack if ever there was:
print "this is win stderr" | "cmd /c more 1>&2"
invoke a shell, pipe to more...
On 29.09.2023 00:40, Mike Sanders wrote:
Mike Sanders <porkchop@invalid.foo> wrote:
Mike Sanders <porkchop@invalid.foo> wrote:
One thing I do wonder about is wheather or not
this is valid under Windows:
if (y < 1) print "error" > "/dev/stderr"
In Windows, its simply 'nul' in the current directory.
No not 'nul' (got ahead of myself), rather:
stdin: 0
stdout: 1
stderr: 2
Still using /dev under Windows seems odd.
This works, but feels like a hack if ever there was:
print "this is win stderr" | "cmd /c more 1>&2"
invoke a shell, pipe to more...
(This is probably a question for a Windows/DOS newsgroup
and likely off-topic here. Anyway. Let's make guesses...)
Does DOS support a 'cat' command? - If so then you can maybe
use one of the redirection patterns that are also suggested
for Unix...
print "error" | "cat 1>&2"
(Or maybe the DOS'es 'type' command may replace 'cat' here?)
For Unix (to be tried out for DOS) there's also
print "error" > "/dev/tty"
to get the message directly to the terminal in case that is
the basic requirement, as opposed to redirecting it to FD:2
(which may or may not be the terminal depending on settings
in the surrounding environment).
Janis
Kenny McCormack <gazelle@shell.xmission.com> wrote:
Wow! Haven't heard anything about ZOC in decades. Does it still exist?
In what form? What has it evolved into?
(Just out of curiosity, why *did* you mention it here?)
Dude you should see it these days! Even custom scripting using REXX
(popular on IBM mainframes, really great under Windows whitch seems
to lack anything worth using scriptwise natively):
Well, this whole *debacle* (I always wanted my own debacle!) caused
a spat of emails on my end & since I was anwsering them here, I
included a question from a gentleman (who should consider posting
- sorry if you're reading), but is maybe a little reluctant to do
so, or then again, maybe he's right on the money. Anyhow, he wants
ZMODEM xfer protocol.
Note: I used ZOC way back when in OS/2 days - for serial comms only.
Nobody uses serial anymore (and if they did, all you need is screen(1)),
so is there any point in ZOC anymore?
I use it as it has a tabbed interface, & more options than I could ever
use.
Nah its all good Kenny. Nice to hear from you again. I see you're still out >in the world & kicking. I've learned *alot* from your posts over the years...
(This is probably a question for a Windows/DOS newsgroup
and likely off-topic here. Anyway. Let's make guesses...)
Does DOS support a 'cat' command? - If so then you can maybe
use one of the redirection patterns that are also suggested
for Unix...
print "error" | "cat 1>&2"
(Or maybe the DOS'es 'type' command may replace 'cat' here?)
For Unix (to be tried out for DOS) there's also
print "error" > "/dev/tty"
to get the message directly to the terminal in case that is
the basic requirement, as opposed to redirecting it to FD:2
(which may or may not be the terminal depending on settings
in the surrounding environment).
And two or three more suggestions... (partly more drastic)
use system() with the DOS specific commands composed as string
concatenated argument.
If you have control over the system you are working on; install
a Cygwin environment and run it in that Unix emulation.
Use a partition on your Windows disk for a Linux emulation.
Or use a live version of Linux from an USB-stick to run that.
I've never been at all impressed with/by REXX. Back when OS/2 was a thing, they were always raving about it (and how great it is), but it always
looked ugly to me.
You could say that REXX is (was) JCL done right, but it is still JCL.
I.e., if you come from an IBM mainframe background (as a lot of OS/2'ers did), and are used to less-than-great things like JCL, then REXX looks
great. But if you're coming from a Unix background, where good (and sometimes wonderful) scripting languages are common, then REXX looks like, well, not-so-great.
I don't understand this paragraph, but no matter.
Do you run it under MS Windows, then?
I'm here all week.
there must be some context you are considering that provides the actual security
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
there must be some context you are considering that provides the actual security
Yes, I think I've *just got it* Ben. Let me qualify it by saying
a: it considers only ASCII chars (other chars will simply pass though
as is), & b: my brain hurts...
Hope to roll it all together & post a conclusion probably next week, real life
work awaits just at the present. A quick preview shows I blow no smoke...
# init_map(password): Initializes and returns the substitution map based on # the provided password. The password influences the ordering of characters # in the map.
#
# sanitize_password(password, base): Sanitizes the provided password by # removing any character not present in the base character set. It also # ensures that each character is unique in the sanitized password.
#
# mCrypt(str, password, mode): Depending on the mode, it either encodes or # decodes the input string str using the substitution cipher. Mode 1 is for # encoding, and Mode 0 is for decoding. The function returns the transformed # string.
#
# The string variable 'base' contains all printable ASCII characters except # newline ('\n'), which are in the range 32 to 126 inclusive.
Is this just fun side project or are real data going to be involved?
[...] I like system() as its intrinsic to most every awk.
$ awk 'BEGIN{system("true")}' ; echo $?
0
$ awk 'BEGIN{system("false")}' ; echo $?
0
$ awk 'BEGIN{exit(system("true"))}' ; echo $?
0
$ awk 'BEGIN{exit(system("false"))}' ; echo $?
1
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 920 |
Nodes: | 10 (0 / 10) |
Uptime: | 104:00:19 |
Calls: | 12,189 |
Calls today: | 1 |
Files: | 186,527 |
Messages: | 2,237,508 |