General :: Processing Script That Find Latest Version Of Each File
Mar 5, 2011
I want to write a script. I have the basic form working... but I would like to add some advanced features. I have a list of .zip files that have a version number in the filename (i.e. sudoku-134.zip, sudoku-176.zip, sudoku-203.zip, etc). I would like to have a script that will find the latest version of each game, and unzip it. I want the next to latest version left untouched. But anything older, I would like the unzipped folder deleted (But leave the .zip file)
Here's what I have so far:
Code:
#!/bin/bash
cd /var/www/vhosts/server.com/httpsdocs/games/$1
for file in `ls *.zip`; do
if [ -d ${file%.*} ]; then
echo
else
mkdir ${file%.*}
cd ${file%.*}
unzip ../$file > /dev/null
cd ..
echo 'date' $file >> /var/www/vhosts/games4roku.com/private/$1.log
fi
done
I can call the script with "game-unzip public" to unzip all the public games.
Here's my files:
Code:
sudoku-134.zip
sudoku-134/
sudoku-176.zip
sudoku-176/
When I add the latest version, sudoku-203.zip, I want it to unzip it to ./sudoku-203/ and rm -rf sudoku-134
View 2 Replies
ADVERTISEMENT
Aug 5, 2011
If I go to the website and download the ISO file is it the exact same one that was released in April or will it contain the latest patches (e.g. security fixes, etc) that have been release since then? If it doesn't I suppose I'll have to download the entire ISO file, install the OS, and then have another couple hundred MB to download which is not what I'd prefer.
View 2 Replies
View Related
Apr 1, 2010
I am using hostapd, wireless tools with madwifi for my wireless ap in my board. The WEP, WPA-PSK connections and communications between my board with linux and my desktop PC, Windows XP SP2 (with Olitec USB wireless) are fine. But when I configured the WPA type, the connection seems established but shows the status "TKIP - Key Absent" in the security dialog box. Anyone faced this problem? Am attaching the conf files and the connection status. In the AP side am complaining . I am using the in built radius server conf with the hostapd 0.4.7
[Code]...
View 1 Replies
View Related
Nov 10, 2010
Synaptic just gives me version 1.7.1, but I want version 1.7.3 without the need to download and build from sources.
View 3 Replies
View Related
Mar 25, 2010
I see a few guides for Ubuntu on a thumb drive, but will it work for Kubuntu?
View 1 Replies
View Related
Oct 23, 2010
Since open office is now bought by oracle I am confused about the state of the latest version of OO version 3.2 I think. Would it be legal to install that version on a computer. Oracle perhaps made a bummer with this. The real dev community is thrown out and we are again looking at corporate greed taking precedence for their own profit rather than development of technology. I have high hopes from libre office but then one more open source product (it was not sun's to begin with remember) being swallowed by a corporate.
View 4 Replies
View Related
Mar 18, 2011
Explain me in detail step by step procedure to install ubuntu latest version in laptop.
View 4 Replies
View Related
Jun 13, 2011
I'm using Ubuntu 11.04. I'm searching for an automated way of installing the latest version of Flash for Firefox. We are using our machine as a testing server and it would be nice to be assured we always have the latest version of Flash instead of having to manually update it whenever Adobe comes out with an incremental update.
View 6 Replies
View Related
Jul 1, 2010
just brought a revo 3610 with l linpus os i need to install the latest version i have downloaded it how to i get it on to the sytem Please dont be to technical (silver surfer)
View 1 Replies
View Related
Apr 6, 2010
I'd like to upgrade the latest version of Mozilla Firefox?
View 3 Replies
View Related
Jan 21, 2011
I have install windows XP and Fedora-14-X86_64 on dual boot, I want to run other OS on fedora by using Virtual machine. I have download and installed VirtaulBox-4.0.0 successfully but I cannot able to start it. I got error about Vbox driver not installed [error code:1908]. I have also installed DKMS package, but also didn't work.
Finally I found the actual problem was kernel not compatible with latest version of vbox and I need to update my kernel-headers. I also meet that solution by using command: yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel and its work fine, this command download and install the kernel compatible VirtualBox-3.2.* and now its works fine.
But problem is that when I booting my PC, it shows 3 options for entering OS rather then 2.
1. Fedora-14 (2.6.35.10.74.X86_64) [which is new one/updated after using that command]
2. Fedora-14 (2.6.35.6.45fc14.X86_64) [which is new one/updated after using that command]
3. Other [windows XP]
How can i delete that old version- No.2?
View 8 Replies
View Related
Feb 10, 2010
I am new to Ubuntu, I installed the latest version and when I turn it on I get like a distortion of the screen, I would gladly post a picture of it but I have no where to post it here. I am running Amd Opteron 175 with DFI Expert and GeForce 7800GT I made a partition on my Vista. I uploaded the pictures as you can see it has the distorted window in background and it just sits there saying 128%.
View 8 Replies
View Related
Jan 7, 2010
i want to know, which RTlinux core(source) is compatable with fedaro latest version.
View 7 Replies
View Related
Aug 24, 2010
I am using redhat linux enterprise linux 5, how to find out the linux kernal version and kernal configuration file location .
View 2 Replies
View Related
Mar 10, 2010
I am using Nagios 3.2.4 monitoring tool on a Linux box with Fedora 10 installed on it and Apache version is 2.2.10. I would like to upgrade my Fedora version from 10 to latest version Fedora 13.
View 9 Replies
View Related
Apr 8, 2010
I am working on the script parsing specific message "TEST" from multiple file. The log file name looks like:
N3.2009-11-26-03-05-02.console.log.tar.gz
N4.2009-11-29-00-25-03.console.log.tar.gz
N6.2009-12-01-10-05-02.console.log.tar.gz
I am using the following command:
zgrep -a --text "TEST" * | awk -F"[ .,]" '{sub(".*:","",$6); sub(",.*","",$7); print $1,$6,$7,$10}
and getting
N3 2009-11-25 20:12:57 TEST
N4 2009-11-28 10:42:18 TEST
N6 2009-12-01 10:00:24 TEST
If I only want to search the log file after 2009-11-29, what shall I change the command?
View 1 Replies
View Related
Mar 21, 2011
I am using cent os 5. When we turn on the PC I can see things which are going to be loaded and the status is [ok] in green colour. Which file linux uses for this process.
View 1 Replies
View Related
Jan 21, 2010
"Read from socket failed: Connection reset by peer" after installing latest version of openssh under debian. What to do?
View 5 Replies
View Related
Sep 29, 2010
how to find the latest modified directory. I know that the command 'ls -rtl' gives the latest modified file/directory at the end. But my specific requirement is: If I create two directories named dir1, dir2 in the same order. so now my latest modified directory is "dir2". Now inside each directories, I created a file. Now in the last, I modify the file in "dir1". So overall, the content of dir1 got modified recently. If I use the command 'ls -rtl', this will still show dir2 as latest, as it is created recently. But I want the directory in which any internal content at any sub-hierarchy modified recently. so with what linux command I'll get this latest modified directory (dir1)?
View 3 Replies
View Related
Jan 3, 2011
How do you find your threads and posts sorted with the latest first?
View 1 Replies
View Related
Jan 27, 2011
I'm a freelance science editor; I edit dissertations and manuscripts for submission to peer-reviewed journals primarily. My clients almost exclusively use Microsoft Word. Any word processing tool that I use has to be compatible with MS Word, particularly "Track Changes" version control. Has OpenOffice (or another open source word processing software) achieved this?
View 1 Replies
View Related
Jun 7, 2010
I am searching for a file in a specific folder using the following command and storing it in a log file
find . -maxdepth 2 -type f -name "components.xml" -print | while read obj
do
basename `dirname $obj` >> avail_list.log
done
Here I want to do the following
1. Store each entry after processing in an array variable.
2. Use this array variables as arguments to function calls.
Here my primary objective is to store the entries from 'find' command in an array. So it is ok for me if I am not creating the log file.
View 5 Replies
View Related
Jan 12, 2011
RedHat, Ubuntu, Fedora, cowpat, urinestain, papsmear. Who is the bureaucrat behind this mess? I believe it is a conspiracy to keep it exclusive.
View 11 Replies
View Related
Dec 30, 2010
A month ago, my HP Mini 1035NR, with a Windows XP system died. Since then, it won't boot into Windows. I tried installing Ubuntu via a bootable USB with no luck. I have finally been able to create a working bootable USB running the Gnome version of Open Suse 11.3.
Aside from not picking up my ethernet connection to the Internet, my bigger issue is I can't install Open Suse from the USB. I get a message when I try to install that there may not be enough memory and it hangs at the section where you choose your time zone. I would like to install the latest version of Open Suse with KDE. Is there anything else I can do?
View 9 Replies
View Related
Mar 26, 2010
I have wine 1.0.1 , I don't know how to install the latest version ? should i remove the one I currently have?
View 9 Replies
View Related
Jun 17, 2011
I downgraded from 11.04 to 10.10 due the problems, one thing I don't like is that Ubuntu dosen't give the latest updates of most software if the OS isn't the latest, such as LibreOffice, Firefox, WinFF etc. is there a way to get the updates to do that?
View 2 Replies
View Related
Apr 2, 2009
I'm so tired on how i can change the resolution of my suse 7.3 because i change my monitor into a wide flat screen.
but now i decided to upgrade my OS in to the latest version of suse but i don't have any idea on how to start because i have alot of files and important application in 7.3 i worried if i upgrade my OS it will erase my files and application. does anyone know to do it. i want to upgrade but i dont want to loose my files and application.
View 2 Replies
View Related
Nov 18, 2010
how i can upgrade to the latest version of yum on a Centos 5 box?
View 4 Replies
View Related
Jan 25, 2010
I have a bunch of tar files in a folder with the name in 'file_name.MMDDYYYY.HH.mm.SS.tar' format. I need to write a shell script that picks latest and greatest of the above tar files and extracts it to a particular folder
View 1 Replies
View Related
Sep 18, 2010
Debian 504 64-bit
Emacs 22.2.1
I have emacs running on the box
$ apt-cache policy emacsemacs:
Installed: 22.2+2-5
Candidate: 22.2+2-5
Version table:
23.1+1-4~bpo50+1 0
1 [URL]
*** 22.2+2-5 0
500 [URL]
100 /var/lib/dpkg/status
But I need to upgrade it to the latest version 23 which is NOT on repo.
View 8 Replies
View Related