Jump to content

Deo Favente

Members
  • Posts

    7
  • Joined

  • Last visited

Deo Favente's Achievements

New Here

New Here (1/7)

0

Reputation

  1. Well what do you know. I tottally forgot i do have another chance to try it! But this time i have 4 levels between the top and the abc, def, ghi folders. So i tried my idea and it didnt work. It printed out "cp: omitting directory " then it listed all the directories that matched, and at the end it printed out "cp: cannot stat */*/*/*/jkl" cause it didnt match any folders. I also learned that all the second level folders were named the same thing cool. So then i tried cp -R */xyz/*/*/{abc,def,ghi,jkl,mno} usr/somedirectories/lib/ and that worked yay! I hope i remember to prepend [solved] to the topic title.
  2. Hi, i have a question on how to use the cp command. I already comepleted the job, but i would like to know how i could use cp to shorten what i did so i could learn how to use it next time. So for work i needed to copy a bunch of files. This is what my directory tree looks like: there are 48 directories in level 1. The directories below don't always exsist in all 48 direcetories, but i want the directories abc, def, and ghi and their contents copied over to /usr/somedirectories/lib/ so that there will be lib/abc, lib/def, and lib/ghi. All files have different names (or should- there might be one or two human errors i can take care of manually, never know) so i want everything to merge, and there are plenty of duplicate folders and some folders might be empty. My current idea is cp */*/{abc,def,ghi,jkl,mno} /usr/somedirectories/lib/ does this work? what's wrong with it? I've already copmpleted the job so i cant try it on anything.
  3. Thank you for helping me learn how to use wget i bet this will help later too. But now i realize i have two more questions: 1)How do i tell wget to not print out an output file? Or should i just do "rm wget-log" 2)How do i tell wget to stop after the window has been closed? is there any easy way of doing this? Edit: Actually i have 3 3)How can i see if a domain is available? This is my attempt is it correct? There are multiple mirrors, map_dl_mirror is the mirror wget -d -r -np -nd -A .pk3 $map_dl_mirror || echo "WGET failed downloading." Is there like a goto statement or maybe like some kinda loop i can put this in? Here is my entire function so far: #!/bin/bash function dl_maps { cat << .end Select your mirror: --------------------------- [1]1337-h4x0rZ [2] [3] [7] .end read dlmirror case "$dlmirror" in "1") map_dl_mirror = "http://h4x0rz.bounceme.net/Urban%20Terror/maps/" ;; "2") map_dl_mirror = "" "8") *) echo "Invalid option" dl_maps esac wget -d -r -np -nd -A .pk3 $map_dl_mirror || echo "WGET failed downloading." } Edit 2: Opps i miscounted there are only 7 mirrors i orginally had put the number 8. And mine's the best cause last week i had 186+ maps i have to check how many there are now. And i fixed the .end, i forogt it has to be all the way to the left.
  4. i just tried this and i have two problems 1) i want to put all the files in whatever direcotry i am currently in, i tested this on my desktop and it puts them in h4x0rZ.bounceme.net/Urban Terror/Maps. Maybe we could get rid of the recreate directories. 2) i want to only download .pk3 files because when it does this it downloads all the possible .html files created when broswing the directory. If you go to my website and click on "name" to sort by name you will have a file named index.html?C=N;O=D
  5. wow thanks that really shortens up my code, thanks
  6. Automatically download all the files ending in .pk3 in http://h4x0rz.bounceme.net/Urban%20Terror/maps/
  7. Hi, im new to linux and i wanted to make an install script to automate the installation of a game, but i have no idea what bash is. I was wondering if someone could help program two sections of the code i need. That would be great because the rest of the script is the same thing almost. First the script checks if the user is root or not, b/c this is where the game is installed if [ `id -u` != 0 ] then destpath="${HOME}/Games/UrbanTerror4/q3ut4" else destpath="/usr/local/games/UrbanTerror4/q3ut4" fi (this is all i can code so far) then it downloads all the files ending in ".pk3" at this location: "http://h4x0rz.bounceme.net/Urban%20Terror/maps/" to the destpath location on the user's computer, WITHOUT overriding any files. This is what i currently have that does the same job but is more manual: cd ${destpath}/q3ut4 maps_dl_url="http://h4x0rz.bounceme.net/Urban%20Terror/maps/" wget - c 'http://h4x0rz.bounceme.net/Urban Terror/maplist' maplst=`cat maplist` for map in $maplst; do ${wget_bin} ${maps_dl_url}/${map}.pk3 done rm maplist This sucks cause i have to update the text file manually.
×
×
  • Create New...