Recent content by imported_Frank

  1. I

    bash: getting line number of a specific word in a text file

    Awesome, that's exactly what I was searching. Thanks BingBongWongFooey. Nothinman, sorry for the confusion, I used "bash" in the title to keep the windows folks away heh.. Frank
  2. I

    bash: getting line number of a specific word in a text file

    Hello! I'd like to know how can I get the line number of a specific word (found using a regular expression) in a text file using a bash script? Thanks everyone :) Frank
  3. I

    BaSH: another problem with script

    I did a few tests and it pointed me out that 2> /dev/null is not the same as > /dev/null 2>&1. From my tests, I think that the difference is that the first one only hides the error messages and the second one hides the error messages AND the normal stdout messages. Frank
  4. I

    BaSH: another problem with script

    Ahh, you are right, I forgot this one :S Is 2> /dev/null the same as > /dev/null 2>&1? Thanks, Frank
  5. I

    BaSH: another problem with script

    Ah! Thanks all for the answers, I got everything working properly now. The only problem is the /dev/null'ing of some commands that doesn't work.. :S Is there any way of "muting" a command by using quotes? > /dev/null isn't working on every command that outputs something. Thanks, Frank
  6. I

    BaSH: another problem with script

    I worked some time on it and now it works better, it says, as the error: Looks like it performs $2 as a command?!?!?!? BTW: As soon as this part works, I'll > /dev/null the output of tar to hide the Removing leading`/` from member names.. it's quite ugly :P Thanks, Frank
  7. I

    BaSH: another problem with script

    Ooops, was wrong, I used `, not single quotes. If I remember, I tried modifying the script to try it with `s, 's and "s. Which one should I use for date, so I could work on the problem while being sure that I used the right quotation..? Thanks, Frank
  8. I

    BaSH: another problem with script

    Single quote, even though, could there be anything else causing the script error? Thanks, Frank
  9. I

    BaSH: another problem with script

    Yep yep, it's me again! In my kick-ass script *roll eyes*, I want to do a tarball backup of a user's home directory and then delete the user's account and the user's home directory, leaving a tarball backup of the deleted directory in /root/users_deleted. Here's the part of the script: With...
  10. I

    BaSH scripting problem: searching line bug!?!?

    Once again, you solved my problem! Very interesting thread btw. Thanks again! See you in my next Q thread ;) Frank
  11. I

    BaSH scripting problem: searching line bug!?!?

    After reading back my code.. looks like that the "working" code doesn't work, as it adds a user IF it finds the line with the user in /etc/group. Because it adds the user, it means that it can find the line with the user, a line that doesn't exist. Now I'm all mixed up :S Frank
  12. I

    BaSH scripting problem: searching line bug!?!?

    Hello! It's me again! I got a big problem that I could bet 50$ that it is a dumb one (as always, big problems are always easy to solve, you just need to think about it :S). What I want to do is to cat | grep /etc/passwd to see if a user exists on the system. I also tried with ls -lh /home...
  13. I

    bash: compare a variable to a text string

    Ahhh, needed a blank space between the " and the [ ]'s... Can't beleive I lost all this time on a dumb problem like this one :S Thanks again folks!
  14. I

    bash: compare a variable to a text string

    Thanks for searching but I've been working on this problem for more than two hours and, according to this how-to: should work as asked, but in fact, all it says is an error such as: This error is all I could get in the hours I worked on this problem :( Frank
  15. I

    bash: compare a variable to a text string

    Hello! I'd like to know how, in my bash script, I can compare a variable to a text string.. just like in php: The variable needs to be compared to a text string, no numbers :) Thanks all! Frank