shanenin

Moderator
  • Content Count

    3752
  • Joined

  • Last visited

Everything posted by shanenin

  1. if he is making a batch script to clean customers computers, which he is going to carry on a usb drive. I would think he would be running as admin. There is still the problem of use profiles in odd spots.
  2. my thought was to use a for statment to go thru and delete the needed data for all users. Since all of the users are listed under c:\documents and settings\ I could do something like this. I was just testing this in the shell. first I am changing to the directory documents and settinds then trying this for %i in (*) do echo %i% it is running with out echoing anything or giving me an error. I thought one time it worked for me, but I forgot the syntax I used. I read in a doc you use %%i for scripts, but in the shell you use %i . Does my for statment look wrong? edit added// this seems to work
  3. you would for example do %HOMEDRIVE%%HOMEPATH%\Local Settings\History
  4. is there a way to do command substitution with batch? for instance the output of dir C:\documents and settings I was wanting to use that output with a for statment. for example for %%i in `dir C:\documents and settings` do this
  5. there is this hardware device desighned to work with tvs http://www.sondesigns.com/html/tvg_faq.html
  6. do you mean sub titles or closed captioning? some subtitles are directly burned into the movie, those dvds could not be altered. As to the other type of subtitiles, that is years(maybe a lifetime) above my ability.
  7. I would start to learn an easy programming language. I am working on python myself, it seems very noob friendly. It makes sence to learn the basics of programming. I get the impression, if you know one language, you can probably learn them all. That is oversimplified, but all laguages seem(from my novice point of view) more similar then different
  8. I have only written maybe a 6 line batch script myself, but have fun trying to code :-) I am not quite following, could you give me an example
  9. Thats what I did to be safe, but was not sure if it was really nessesary.
  10. If I have one harddrive set to master, and I have a second set to slave, does it matter where on the ide cable they are plugged in? will the drive set to master be at hd0 no matter what postition on the cable it is(the end or the middle)?
  11. Thanks, that worked. doing dumb stuff like that, I wonder how I ever manage to get anything to work. If you care to save a few keystrokes when remnaming stuff feel free to use this script #!/bin/sh # for this script to work you must be in the directory that contains the files you # want to rename clear echo "Does the directory listed contain the files you would like to rename?" echo echo "`pwd`" echo echo "enter return to continue, or type 'quit'(and return) to exit the script and change to the correct directory" read F if [ $F = "quit" ] then exit fi clear for i in *; do clear
  12. I am writing a script to rename avi files. The current files have spaces in them from the current directory I have these two titles. for example "sopranos-301 the car episode" "sopranos-302 the murder episode" I am running the script from the directory the files are in for i in *; do echo "enter the new name you would like to change the file to" read INPUT # i have the mv command in quotes because the file has spaces in the name mv \"$i\" ${INPUT} done it is giving me an arror about mv can't move multiple files to a non directory. As far as I can see \"$i\" is only specifin
  13. thanks for the explanation. it turns out my script was pretty meaningless. I could have just done [[ ${VAR} == *[^a-bA-B1-9]* ]] or [[ ${VAR} == *[^[:alnum:]]* ]]
  14. I have been messing around with a bash script to test if characters are in a string #!/bin/bash read PASS X=${#PASS} Y=0 while (( Y < X )); do if [[ ${PASS:$Y:1} != [a-zA-Z1-9] ]]; then break fi let Y+=1 done (( Y == X )) notice this line in particular while (( Y < X )); do I called my variables without using the $ like this $Y and $X, and it still works. WHY? it also works like this while (( $Y < $X )); do
  15. doing it like this works #!/bin/bash PASS=asdfghjkl if (( ${#PASS} > 7 )) && (( ${#PASS} < 11 )) then echo "works" fi
  16. I am trying to use bash to test for the length of a string. Nothing seems to be making sence to me. this code tests(and works) for a string larger then 7 #!/bin/bash PASS=asdfghjkl if [[ `echo ${#PASS}` > 7 ]] then echo "works" fi but it fails with an error if I use '>=' like this. Why? #!/bin/bash PASS=asdfghjkl if [[ `echo ${#PASS}` >= 7 ]] then echo "works" fi I would think the following code would test for a string larger then 7 but smaller then 11, but this is not testing as true, it is testing as false #!/bin/bash PASS=asdfghjkl if [[ `echo ${#PASS}` > 7 ]] &a
  17. those methods work much better then my convoluted mess.
  18. I was helping someone write a bash script. I needed to have a counter in a while loop. in python you can do this x=x+1 or x+=1 in bash I had to do it this way, I needed to look this up x=`echo "$x + 1" | bc` wow, that just seems rediculous. Also is there a logical reason bash does not use these operaters(<,>,<=,>=) instead it uses (-eq,-ne,it,ie)
  19. I am having a tough time understanding what is going on in this following code class Player(object): """ A player in a shooter game. """ def blast(self, enemy): print "The player blasts an enemy.\n" enemy.die() class Alien(object): """ An alien in a shooter game. """ def die(self): print "The alien gasps and says, 'Oh, this is it. This is the big one. \n" \ "Yes, it's getting dark now. Tell my 1.6 million larvae that I loved them... \n" \ "Good-bye, cruel universe.'" # main print "\t\tDeath of an Alien\n" her
  20. I agree, the best solution is to have a shared fat partition.
  21. the shutil module seems to be what I needed. shutil.copy(file,destination)
  22. I have been reading through the "python library reference" with no luck finding the module needed to copy a file. Any help would be appreciated.
  23. a month ago(just before my book purchase), I would not have been able to give you that advice. Ever since I bought my book "sams teach yourself shell(bash) programming in 24 hours", my linux skills have gotten much better, because the linux OS heavily uses bash scripts. I WOULD HIGHLY RECOMMEND ANY ONE USING LINUX TO STUDY BASH SCRIPTING. If I could say one skill that has helped me understand and use linux better, it would be knowing basic bash scripting. I stress basic, I am hardly a programmer, but know just the basics. A book is not nessesary, I just like getting away from the computer, a b
  24. which method did you use, I gave you two different suggestions, just curious?
  25. I deleted my previous post, this is an updated version which should work properly To disable your hardware clock being changed at shutdown. You need to edit the file /etc/init.d/hwclock.sh . place the following line of code any where near the beginning after the first line #!/bin/sh HWCLOCKACCESS=no