Results 1 to 4 of 4
Hi all
Was wondering if any of you guys can help me. I unrar quite a few files and I like to see the time it takes. So a simple ...
- 07-09-2009 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 5
Very Simple Unrar script needed
Hi all
Was wondering if any of you guys can help me. I unrar quite a few files and I like to see the time it takes. So a simple cmd like:
time unrar e file
will unrar and give me time taken at the end. Im after a script that will add time unrar e by itself so all i have to type is one cmd with filename. Something like:
urar file
The script will do the time unrar e
I tried this:
#!/bin/bash
time unrar e
saved that as urar.py
Saved it and made it chmod +x but when i did ./urar.py file
But that didnt work
Any help would be great.
Many thanks
- 07-10-2009 #2Just Joined!
- Join Date
- Jun 2009
- Location
- Toronto
- Posts
- 18
Just add the argument to the command for a bash script:
I don't know why you're saving it as .py though... that isn't python code. just save it as 'unrar'#!/bin/bash
time unrar e $1
- 07-10-2009 #3
While cgrebeld's solution would work for your script you may want to look into alias'. An alias will let you create your own commands. So if you set an alias like this:
Then you will be able to use the command:Code:alias trar='time unrar e $1'
In any directory you want, rather than having to run a script. When you end your session the alias will be lost so you may want to add the alias line to your .bashrc fileCode:trar filename
Linux User #453176
- 07-10-2009 #4Just Joined!
- Join Date
- Jul 2009
- Posts
- 5
Both of you guys are fantastic. Thanks for all the help. This is just what I needed
Cheers


Reply With Quote