neubejiita Posted June 22, 2012 This command will search a wadfile and return what map it is. C:\HOME\FLYNN\DOCUMENTS> cat Quadruple\ Threat.wad | strings | grep MAP[1-32] MAP28 BLOCKMAP And this for Ultimate Doom wads. C:\HOME\FLYNN\DOCUMENTS> cat base.wad | strings | grep E[1-4]M map E1M1 "Phobos Tech Center" next E1M2 music D_E1M1 map E1M2 "Phobos Entrance" next E1M3 music D_E1M2 map E1M3 "Phobos Hell Gate" next E1M4 music D_E1M3 D_E1M1 D_E1M3 D_E1M2 D_E1M4 E1M3 E1M2 E1M1 I hope you find this tip useful. I could not be bothered to load up Doom Builder or Slade, so I thought I would try this instead. Using this on the Doom2 IWAD gives the expected output. C:\HOME\FLYNN\DOCUMENTS> cat Doom2/doom2.wad | strings | grep MAP[1-32] MAP10 MAP11 MAP12 MAP13 MAP14 MAP15 MAP16 MAP17 MAP18 MAP19 MAP20 MAP21 MAP22 MAP23 MAP24 MAP25 MAP26 MAP27 MAP28 MAP29 MAP30 MAP31 MAP32 0 Share this post Link to post
fraggle Posted June 22, 2012 neubejiita said:Tip for Linux Doom players. C:\HOME\FLYNN\DOCUMENTS> I really hope you haven't done what I think you've done. Also, you win a triple award for useless use of cat. Finally, just to be snarky, in all future WADs I might release I promise to include a useless lump containing the text "MAP99", just to break your script. 0 Share this post Link to post
boris Posted June 22, 2012 Also the grep doesn't do what you probably think it does. Anyways, I'd rather use something like grep -P '^(MAP\d\d|E\dM\d)$' 0 Share this post Link to post
andrewj Posted June 22, 2012 fraggle said:I really hope you haven't done what I think you've done. $PS1 abuse? 0 Share this post Link to post
neubejiita Posted June 22, 2012 fraggle said:I really hope you haven't done what I think you've done. Also, you win a triple award for useless use of cat. Finally, just to be snarky, in all future WADs I might release I promise to include a useless lump containing the text "MAP99", just to break your script. I used the PS1 prompt example from this thread. http://www.doomworld.com/vb/everything-else/59860-doomworlds-desktop-wallpaper-thread/ that chungy posted. I am running Linux Mint 13 x64. 0 Share this post Link to post
fraggle Posted June 22, 2012 neubejiita said:I used the PS1 prompt example from this thread. http://www.doomworld.com/vb/everything-else/59860-doomworlds-desktop-wallpaper-thread/ that chungy posted. That's what I feared. Horrible and perverse :-( 0 Share this post Link to post
ellmo Posted June 22, 2012 fraggle said:That's what I feared. Horrible and perverse :-( Real Linux users use D:\Program Files x64\Home\<user_name> 0 Share this post Link to post
qoncept Posted June 22, 2012 fraggle said:I really hope you haven't done what I think you've done. Also, you win a triple award for useless use of cat. Finally, just to be snarky, in all future WADs I might release I promise to include a useless lump containing the text "MAP99", just to break your script. I don't think so. Of course, as Heiner points out, using cat on a single file to view it from the command line is a valid use of cat (but you might be better off if you get accustomed to using less for this instead). 0 Share this post Link to post
boris Posted June 22, 2012 qoncept said:I don't think so. But he isn't viewing a single file from the command line, but piping its contents into another command. cat'ing single files into programs that could read the file on their own is just stupid. So just strings doom.wad 0 Share this post Link to post
chungy Posted June 22, 2012 neubejiita said:I used the PS1 prompt example from this thread. http://www.doomworld.com/vb/everything-else/59860-doomworlds-desktop-wallpaper-thread/ that chungy posted. fraggle said:That's what I feared. Horrible and perverse :-( Not sure if I should feel proud or worried that someone actually uses it seriously. 0 Share this post Link to post
CODOR Posted June 22, 2012 fraggle said: Also, you win a triple award for useless use of cat.In examples like this "cat" is probably preferable as the general form since it's clear one could replace it with "unzip -p wadfile.zip" or whatever without changing the structure of the command. Finally, just to be snarky, in all future WADs I might release I promise to include a useless lump containing the text "MAP99", just to break your script.neubejiita's command won't show it; MAP[1-32] only matches MAP1, MAP2, MAP3 and MAP2 (again). boris's version would break in this manner though, except I think the intent in either case is to quickly figure out what level to warp to in a random WAD that might be missing its accompanying TXT file. If someone wanted something more robust they could probably use lswad from xwadtools. (But then you could still throw in empty MAP99 lumps to confuse things. Plus the unzip trick can't be used without temporary files or maybe some fancy redirections...) 0 Share this post Link to post
Nomad Posted June 22, 2012 Instead of telling neubejiita what an idiot he is, you guys could totally explain what he's wrong about instead. I'd do it, but I don't know what he did wrong, and neither would anyone that actually needs some tips for Linux and Doom. 0 Share this post Link to post
Maes Posted June 22, 2012 Nomad said:Instead of telling neubejiita what an idiot he is, you guys could totally explain what he's wrong about instead. Better if not. In typical CS/IT fashion, this would probably result in a massive flamewar and a lot of "That's NOT how we do things in MY neck of the woods!", "If you did this in my workplace you'd get fired", "If you do it in way X that means you're a noob" etc. 0 Share this post Link to post
printz Posted June 22, 2012 I don't understand, does Linux have drive letters? I thought they're referenced somewhere in a Volumes folder or like that. 0 Share this post Link to post
Gez Posted June 22, 2012 printz said:I don't understand, does Linux have drive letters? It doesn't. But you can customize the prompt to show useless stuff before the path. 0 Share this post Link to post
ellmo Posted June 22, 2012 printz said:I don't understand, does Linux have drive letters? I thought they're referenced somewhere in a Volumes folder or like that. UNIXes don't label drives or partitions by letters of course, what you see in neubejiita prompt is simply a modified PS1, which - from what I gather, and I'm no expert - is a formatted string representing shell's prompt. You can modify it to your heart's content. 0 Share this post Link to post
qoncept Posted June 22, 2012 boris said:But he isn't viewing a single file from the command line, but piping its contents into another command. cat'ing single files into programs that could read the file on their own is just stupid. So just strings doom.wad Copying and pasting something that WORKS to get the result you want it stupid. News to me. 0 Share this post Link to post
Nomad Posted June 22, 2012 Maes said:Better if not. In typical CS/IT fashion, this would probably result in a massive flamewar and a lot of "That's NOT how we do things in MY neck of the woods!", "If you did this in my workplace you'd get fired", "If you do it in way X that means you're a noob" etc. Probably the fact that I don't really understand Linux beyond using Ubuntu, but I figure if there are multiple ways to do something successfully, which one is wrong? I mean if one of the methods is a security risk is one thing, but it sounds like this is just a matter of aspies being aspies. 0 Share this post Link to post
Maes Posted June 22, 2012 Nomad said:but I figure if there are multiple ways to do something successfully, which one is wrong? The One True Way of doing the Right Thing (TM) of course. Nomad said:it sounds like this is just a matter of aspies being aspies. You'll have to read the Jargon file three times over to even begin to understand them. And then they'll tell you "No, Nomad. You are the aspies". And then you will be yet another 1337 and condescending linux fanboy ;-) 0 Share this post Link to post
Gez Posted June 22, 2012 Nomad said:Probably the fact that I don't really understand Linux beyond using Ubuntu, but I figure if there are multiple ways to do something successfully, which one is wrong? I mean if one of the methods is a security risk is one thing, but it sounds like this is just a matter of aspies being aspies. The crux of the matter is that if you use cat file | grep instead of grep file, then you run two processes instead of one and it uses more CPU power! Oh noes! Because hyper-optimizing everything, even the listing of Doom maps in a file, an operation you'll do maybe a couple times a day, is how the true computer elite rolls. Mostly it's just a question of geeks knowing How Things Work(tm) and getting annoyed at cargo-cultish behavior in people less geeky than themselves. The "I know this is the best way to do this" vs. "This is how I learned to do it and it works, so it's good enough for me." Kind of like that person who thought they had to open the start menu before clicking on an icon in the quick launch bar. Has to click on the start menu to run a program, after all. It's even in the same region of the screen! 0 Share this post Link to post
Nomad Posted June 23, 2012 Gez said:The crux of the matter is that if you use cat file | grep instead of grep file, then you run two processes instead of one and it uses more CPU power! Oh noes! Is that really the gripe? Ok, so, being conscious about efficiency is one thing, but if having two processes run is a big deal I'd hate to see how one of these autistic derptards feels about me knocking a box of matchsticks on the floor. 0 Share this post Link to post
chungy Posted June 23, 2012 The gripe isn't resources being used (well, not in cases like this), it's the demonstration of doing such displays a lack of understanding of how the software you're using actually works. 0 Share this post Link to post
Phml Posted June 23, 2012 Now imagine you're an expert in communication reading Doomworld on a regular basis. 0 Share this post Link to post
Graf Zahl Posted June 23, 2012 Nomad said:Is that really the gripe? I have the feeling that the true gripe is that some beginner dares to give Linux advice. How any any true Linux geek accept such a transgression...? :D 0 Share this post Link to post
Maes Posted June 24, 2012 Graf Zahl said:How any any true Linux geek accept such a transgression...? :D NEVER! SUCH MISDEMEANOR MUST BE DEALT WITH UNPLEASANT, FORCED AND PAINFUL RECTAL SODOMY FROM RICHARD STALLMAN'S BLOATED DICK!!!!! 0 Share this post Link to post
hex11 Posted June 26, 2012 Maes said:YO hex11 WHERE ART THOU? I wuz banned from da Interwebz for using illegal underground OS!!!#&% Anyway, this is probably what you want (take a look at "wadwhich"): http://www.doomworld.com/vb/doom-editing/59068-xwadtools-updated-again/ 0 Share this post Link to post
hex11 Posted June 26, 2012 Nomad said:Is that really the gripe? Ok, so, being conscious about efficiency is one thing, but if having two processes run is a big deal I'd hate to see how one of these autistic derptards feels about me knocking a box of matchsticks on the floor. It's all a matter of context. A few extra /bin/cat processes running on someone's desktop = big woop. CGI script on busy server that spawns unnecessary processes = bad (well maybe, because sometimes the overhead is hidden and insignificant due to caching). 0 Share this post Link to post