You need an alias. Typing alias sage='open /PATH/TO/Sage.app'
will create an alias which will do exactly what you want, run the program just by typing sage
. The problem is that this will only last until you close that terminal window (bash). So, you need to create that alias each time you run a new bash. To do so, just:
- Create or modify a text file called
.bash_profile
in your home directory.
- Add
alias sage='open /PATH/TO/Sage.app'
on it
- Save the file
- Load the file once by typing
. ~/.bash_profile
Remember that it will be case sensitive, so if you type Sage
(instead of sage
) it won't work.
Let's start with a small example.
Fire up Automator and create a service with a single "Run Shell Script" step.
Set it to take Folders as input from Finder
Pass input as arguments. Shell is /bin/bash
Bash code:
cd "$@"
for file in *.mov *.flk *.mp4
do
ls -1 "$file" >> ~/Desktop/test_file_awk.txt
done
What this does it takes the directory you pass in as "$@" and goes into it then runs the command on all the files in that directory.
"$@" is in quotes to protect against spaces, as is "$file"
So, you can replicate this to your setup:
cd "$@"
i=$(for file in {*.flv,*.mov,*.mp4,*.m4v}
do
/usr/local/bin/mediainfo "--Inform=Video;%Duration%" "$file"
done | awk '{total+=$0}END{print total}')
((i/=1000, sec=i%60, i/=60, min=i%60, hrs=i/60))
timestamp=$(printf "%dh%02dm%02ds" $hrs $min $sec)
echo -e "Total duration of video files in this folder:\n\n$timestamp" > _total_duration.txt
Personally, I would change the output to something like:
> ~/Desktop/"$@"_total_duration.txt
So that the data ends up on your desktop in a file named for the folder, but I have a lot of media directories and I don't want txt files in them.
Best Answer
See How to check when Macbook was turned on first time? for details about the OS install date.
As for anti virus software, there are several products out there. One way to check for installation is to check whether the corresponding application is installed in
/Applications
.