You are not logged in.

#1 2012-10-19 18:27:44

BHReach
Member
Registered: 2008-12-28
Posts: 21

Problem Registering for Forum -> date -u +%W$(uname)...

date -u +%W$(uname)|sha256sum|sed 's/\W//g'

Does not work correctly for bash on my Linux box, bash-4.1_p9, it eats the "-" at the end of the line.

It is supposed to remove the 2 spaces between the hash and the dash, I had to put the dash back before the registration page would accept my input

date -u +%W$(uname)|sha256sum|sed 's/ //g'

or

date -u +%W$(uname)|sha256sum|sed 's/\s//g'

Do work correctly for bash-4.1_p9.

Offline

#2 2012-10-19 18:31:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Problem Registering for Forum -> date -u +%W$(uname)...

BHReach wrote:

date -u +%W$(uname)|sha256sum|sed 's/\W//g'

Does not work correctly for bash on my Linux box, bash-4.1_p9, it eats the "-" at the end of the line.

bash 4.2.037-1 from [core] doesn't display the '-' either.

Offline

#3 2012-10-19 18:42:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Problem Registering for Forum -> date -u +%W$(uname)...

Moving to Forum & Wiki discussion


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2012-10-19 19:12:16

headkase
Member
Registered: 2011-12-06
Posts: 1,975

Re: Problem Registering for Forum -> date -u +%W$(uname)...

bill@Jeremiah ~> date -u +%W$(uname)|sha256sum|sed 's/\W//g'
3740f4173d74c1e7bce9812f188120558174869d5183efb5fd3537f2d5fa80c9
bill@Jeremiah ~> pacman -Ss bash
core/bash 4.2.037-1 (base) [installed]

Works fine here and you would assume that on install of an Arch system it would also work fine for those.  Is it convenient?  Not really, but: it is two-fold useful.  1) It really, really cuts down on spammer accounts.  And 2) Arch is a distribution for competent Linux users - you have to be, at least minimally, to do that command.

Offline

#5 2012-10-19 19:16:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Problem Registering for Forum -> date -u +%W$(uname)...

headkase, you mean it failed for you as well.  Your output does not have the trailing dash.

I am assuming (based on the OP) that the dash is necessary to pass forum registration.  So given a current and up to date arch system and a fully competant user, registration would fail.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2012-10-19 19:21:26

headkase
Member
Registered: 2011-12-06
Posts: 1,975

Re: Problem Registering for Forum -> date -u +%W$(uname)...

Ok, it failed - just tried to register with the output.  However, the two points for its rationale still stand.

Offline

#7 2012-10-19 19:24:15

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Problem Registering for Forum -> date -u +%W$(uname)...

Maybe I'm confused, but it seems the '\W' in the sed statement is supposed to filter out the spaces and the dash.

Edit: My point being the problem is with the forum code, not the shell.

Last edited by alphaniner (2012-10-19 19:28:08)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2012-10-19 19:30:07

BHReach
Member
Registered: 2008-12-28
Posts: 21

Re: Problem Registering for Forum -> date -u +%W$(uname)...

Trilby wrote:

headkase, you mean it failed for you as well.  Your output does not have the trailing dash.

I am assuming (based on the OP) that the dash is necessary to pass forum registration.  So given a current and up to date arch system and a fully competant user, registration would fail.

There is nothing wrong with using a complex command to qualify users, just make sure it works for all shells. I posted 2 other forms of the command that work for my bash shell. I think the one with the simple space would work on any shell.

Offline

#9 2012-10-19 19:38:16

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Problem Registering for Forum -> date -u +%W$(uname)...

Offline

Board footer

Powered by FluxBB