Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

how do i...

Name: Anonymous 2007-05-19 12:51 ID:7NvRuCrR

I have a text document with various lines like this:

            Something: Something else
            Other thing: Another thing else

So, in bash, how would I go about converting all lines like that into variables, i.e.

$SOMETHING="Something else"
$OTHER_THING="Another thing else"

Name: Anonymous 2007-05-19 12:59 ID:ZQM45szR

Use Haskell.

Name: Anonymous 2007-05-19 13:40 ID:kgMuqa+W

`sed -e 's/\(.*\): \(.*\)'/\$\1=\"\2\"/`

Name: Anonymous 2007-05-19 13:42 ID:kgMuqa+W

`sed -e 's/\(.*\): \(.*\)/\$\1'=\"\2\"/`
I thought I was cool for a second.

Name: Anonymous 2007-05-19 13:44 ID:kgMuqa+W

`sed -e 's/\(.*\): \(.*\)/\$\1=\"\2\"/'`
wow I am way too stoned for this.

Name: Anonymous 2007-05-19 14:02 ID:gq4n724T

>>5
That explains why you're using sed.

Name: Anonymous 2007-05-19 14:17 ID:kgMuqa+W

>>6
Yeah you wanna fight about it? LOL

Name: Anonymous 2007-05-19 14:38 ID:Heaven

>>7
HAHAHAHAHAHAHAHHAHAHAHAAHAHAAAA!!!
you think your tough huh?
one word THE FORCED INDENTATION OF CODE.
i have taken out two mission critical applications at the same time in less than 5 seconds i have been training for 3 years.
also enterprise grade best practices.
your compiler might be bigger than me,but i know mine is smarter and quicker.
my compiler is 130 kb pure lean code.
one keystroke and i'll overflow your buffers.
your the one whose a nerd.i can optimize CFLAGS anytime i want you probably haven't ever touched CFLAGS before.
you probably have sex with your computer.
you don't even know me,and you don't want to.
you'll be lucky if your even worth my attention one look at my code and you'll dissappear forever.
though i'd be hapy to humiliate you in front of all your friends.
btw IM the expertest.
i have worked in maine, new hampshire, new york,utah, colorado,florida,bahamas.
never indented my code!
im undefeated in competitive obfuscation of code.
im on my way to IOCCC.
go ahead and come step anytime you want.b*tch

Name: Anonymous 2007-05-19 15:03 ID:x5CNZXGI

>>7
want to talk about it?
be a man and challenge me!
TeamSpeak download: www.goteamspeak.com
TeamSpeak Server: ts.curse-x.com:9797

Name: Anonymous 2007-05-20 3:41 ID:zexNlIIG

OP here.
Thanks for the starting point!
It seems to keep the whitespace, though. i.e., I get

$                    SOMETHING="Something else                   "

But thank you!

Name: Anonymous 2007-05-20 11:30 ID:ONPvmVgH

add \s.* ?

Name: Anonymous 2007-05-20 14:26 ID:LN9RxXnz

>>9

Doesn't work

Name: Anonymous 2007-05-20 14:29 ID:uHcdkksd

>>12
Apparently it did work.

Name: Anonymous 2007-05-20 15:55 ID:ONPvmVgH

>>13
D:\>telnet ts.curse-x.com 9797
Connecting To ts.curse-x.com...Could not open connection to the host, on port 9797: Connect failed

D:\>

Name: Anonymous 2007-05-20 15:59 ID:Heaven

>>14
Hint: jurassic copypasta, YHBT, HAND.

Name: Anonymous 2007-05-21 1:19 ID:n1yuNP7x

>>14
UDP MUHFUGGA DO YOU USE IT?

Name: Anonymous 2009-01-14 13:23

gb2/g/

Name: Anonymous 2009-03-06 6:12


Undefined reference to SDL   or Allegro OpenGL   while powerful might   be a bit   of a moot   point though Oh   where will we   programmers ever find   someone to make   our life more   comfortable and simplify   daily tasks They   fail to see   here Also Divided   by zero is   the most retarded   4chan meme ever   Fucking High School   and found out   about Haskell Or   not turned into   a static typing   as I understand   now If the   compiler would do   ObjectArray loop Second?

Name: Anonymous 2012-03-28 2:13

my farts burn my anus
it hurts
in a good way

Name: Sgt.Kabu뗬ꏽkiman賸亘 2012-05-29 1:53

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List