|
From: | John McKown |
Subject: | Re: [Help-bash] help |
Date: | Sun, 6 Mar 2016 20:05:24 -0600 |
Hi John,
Thank you very much!
I chose to put it as a function in my .bashrc.
what happened is that
if I dot give the the two arguments then
ie.,
1. if I type autil : it automatically closed the terminal
2. if I give the two arguments
ie., autil 10 *.txt I go this message
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [_expression_]
******************************
function autil() {
if [ $# -lt 2 ]; then
echo "Sorry, I need at least two parameters:"
echo "The first is the time- how far should I go?"
echo "The second is the name patternsuch as *txt or *csv"
exit 1
fi
time=$1
shift #move all parameters over 1, dropping $1
filetype="$2"
shift #move all parameters over 1 again
find -maxdepth 1 -type f -mtime ${time} -name "${filetype}" "$@"
}
**************************
Is it possible to fix it??
1. why it is closing the terminal?
--
A fail-safe circuit will destroy others. -- Klipstein
Maranatha! <><
John McKown
[Prev in Thread] | Current Thread | [Next in Thread] |