Find the answer to your Linux question:

Search:

Type: Posts; User: Dolda2000; Keyword(s):

Page 1 of 20 1 2 3 4

Search: Search took 0.10 seconds.

  1. That's interesting. Is your distribution not...

    That's interesting. Is your distribution not using GNU sed? Try this instead, see if that makes the problem vanish:

    sed -n '/file_.*_name=/{s/^[^=]*=//; h;}; /file_.*_type=1/{g; p;}'
    (The...
  2. Oh, by the way. If you are sure that the lines...

    Oh, by the way. If you are sure that the lines containing the data you want come before the "type" lines, you can just use sed and its hold space. Try this:

    sed -n '/file_.*_name=/{s/^[^=]*=//;...
  3. Your specification is a bit confused. You say...

    Your specification is a bit confused. You say that you want to find the "location" of the files, but your example of the output lists only the lines which say "name" in the input, not "location".
    ...
  4. Replies
    6
    Views
    17,737

    That is not very weird, though. You are supposed...

    That is not very weird, though. You are supposed to decode the actual exit code with WEXITSTATUS, not WIFEXITED. WIFEXITED checks returns a boolean value reflecting whether the process terminated...
  5. Replies
    4
    Views
    1,187

    That sounds a bit weird to me. I can only think...

    That sounds a bit weird to me. I can only think that the reason for that kind of response would be incompetence on their part, which doesn't seem quite right. Would you mind posting the exact message...
  6. Replies
    4
    Views
    1,187

    There is definitely an easier way. How about just...

    There is definitely an easier way. How about just mailing the administrator in charge of the web site and ask him to reset the password of that account? You definitely shouldn't be trying to use a...
  7. Replies
    6
    Views
    1,728

    What were you expecting, exactly? Since you're...

    What were you expecting, exactly? Since you're allocating 6 bytes, I don't find it particularly strange that you get segmentation faults when you write more than that (even so much as 2568 bytes).
  8. Usually, that depends on the program itself. For...

    Usually, that depends on the program itself. For example, Perl uses the -e switch to receive commands from the command line.

    If sml supports reading commands from stdin correctly, you can probably...
  9. Replies
    7
    Views
    4,060

    That will also have some side effects, though,...

    That will also have some side effects, though, due to sign extension (when the character is 0x80 or above). You'll need to specify that it is an unsigned char, either by using that type specification...
  10. Replies
    7
    Views
    4,060

    No, there is no way to use "half pointers" or...

    No, there is no way to use "half pointers" or anything like you're suggesting. Pointers are integers.

    Instead, you'll have to use bit-wise boolean operations. For example, like this:

    char...
  11. Replies
    6
    Views
    17,737

    Well, it is quite weird, for that is supposed to...

    Well, it is quite weird, for that is supposed to work. In fact, I just took your code verbatim and compiled and ran it on my system, and it worked just as it was supposed to. I hope that I can assume...
  12. Replies
    6
    Views
    2,266

    It's not very strange at all. It's not the...

    It's not very strange at all. It's not the program that gets a SIGSEGV, but the compiler. If you set the stack limit to 10 kiB, then it's not very strange that most programs you try to run will crash...
  13. Replies
    9
    Views
    5,040

    I'm not sure I understand exactly what you mean,...

    I'm not sure I understand exactly what you mean, but could you be referring to something like this?

    for arg in "$@"; do
    cmd = sed -n "s/^[0-9]\+ \+'\(.*\)'$/\1/p"
    if [ -n "$cmd" ]; then...
  14. Replies
    6
    Views
    17,737

    Are you sure that it always returns zero? I'd be...

    Are you sure that it always returns zero? I'd be much less surprised of it always returns non-zero. To get the exit status of a process from system(), you need to pass its return value through...
  15. Replies
    6
    Views
    2,266

    Of course, I can only conjecture as to what the...

    Of course, I can only conjecture as to what the problem is, but the -s option to ulimit controls the stack limit, which is normally set to 2k pages (8 MiB). If such a limit is set, and a process...
  16. Replies
    2
    Views
    1,514

    The format of most of the files in /proc is...

    The format of most of the files in /proc is described in the proc(5) manpage. I'll quote the section on the maps file:

    /proc/[number]/maps
    A file containing the currently...
  17. Replies
    3
    Views
    1,724

    If that (nm) doesn't cut it for you, such as in...

    If that (nm) doesn't cut it for you, such as in the case of a stripped shared object, try the objdump command. In particular, check its `-T' switch.
  18. Replies
    3
    Views
    5,972

    I thought you might have saved the error message....

    I thought you might have saved the error message. Anyhow, are you sure that it really was related to the lower() function? Couldn't it have been that you got the EOFError exception that the raw_input...
  19. Naturally. Many times over, even. I don't know...

    Naturally. Many times over, even. I don't know about C++, but in C, there is at least the hashmap implementation in glib. There is even the envz* functions in standard glibc (glibc, though, not...
  20. Replies
    6
    Views
    2,266

    Maybe this is just me, but if you have to unlimit...

    Maybe this is just me, but if you have to unlimit the stack, then I'd say that the problem you should solve isn't how to unlimit the stack, but rather to not allocate all that much memory from the...
  21. Replies
    3
    Views
    5,972

    I would recommend using Python's builtin...

    I would recommend using Python's builtin documentation system:

    >>> print raw_input.__doc__
    raw_input([prompt]) -> string

    Read a string from standard input. The trailing newline is stripped....
  22. Replies
    26
    Views
    40,601

    Indeed, scm's examples may be the best for this...

    Indeed, scm's examples may be the best for this particular case, but they do have limitations. For example:

    I'm not 100% sure, but I believe this syntax is specific to bash. If you want the code...
  23. Replies
    2
    Views
    1,904

    If it were me, I wouldn't even try to write a...

    If it were me, I wouldn't even try to write a shell script for that. Instead, I'd switch to Perl:

    #!/usr/bin/perl -w

    die "namefile: $!" if !open NAMES, "namefile";
    while(<NAMES>) {
    ...
  24. Sorry, I know of no C tutorials at all. I've...

    Sorry, I know of no C tutorials at all. I've considered writing one, but it's just too much work for me right now. For now, I would recommend what I always recommend anyone trying to learn C: Learn...
  25. Does IIS even support CGI? I always thought it...

    Does IIS even support CGI? I always thought it only did ISAPI.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4