Also, you need a loop for the menu since 'return' doesn't do what you think it does -- it quits the script just like exit does when used there.
thx for your help, and what about the last 2 requirements in question one that is "The long listing of the directory specified by the first command line argument, sorted in reversed alphabetic order.
If the second command line argument is provided, all the above output will be redirected to the file specified by the second argument. If the second argument is not provided, the above output should be displayed on the screen. "and the 2nd question? I have no idea about these 2.
---------- Post updated at 03:33 AM ---------- Previous update was at 03:20 AM ----------
Quote:
Originally Posted by Corona688
Consider [ ] to be commands, not brackets. if[$n is not the same command as [, the spaces are important.
You've left out lots of spaces everywhere and put in semicolons you don't actually need:
You also forgot to use $e here, used the wrong logic(you want || for 'or', since a string can never be 'y' and 'Y' at the same time). Also, -eq is for integers, for strings you want = .
But I think that bit would be simpler as a case:
it shows "head:illegal line count -- Rail-Stations.txt"
and when I fix the 3rd part of the program,like this :
it shows this :
Moderator's Comments:
code tags for code, please.
Last edited by Corona688; 04-16-2012 at 02:45 PM..
Hi,
I want to write a script which will tail a particular file for 15 mins and then sleep for 10 mins and again tail for 15 mins. This cycle will go on for a limited period of time.
How can i ensure that tail command will run for 15 mins before calling sleep command
Thanks (6 Replies)
I have a script that runs every hour from the crontab (see the settings of the crontab below) (15 mins past the hour)
15 * * * * /home/usr/usr1/ProvAll
This script saves two files in the following format
now=`/bin/date '+%Y%m%d.%H%M%S'`
file1.$now (for example)
file1.20140722.031502... (12 Replies)
I need 5 mins old logs to be dumped into a a new file.
The date formats in the two log files are
Can you suggect for both formats ?
bash-3.2$ uname -a
SunOS myserver 5.10 Generic_150400-26 sun4v sparc sun4v
---------- Post updated 05-04-16 at 12:24 AM ---------- Previous update was... (2 Replies)
Hi,
system date format
Thu Jun 13 12:55:18 EDT 2019
My log date format
09.148.192.60 - - "GET /akamai/sureroute-test-object.html HTTP/1.1" 404 231
can someone please help me, how to get last 5mins of logs please ? I need the command
Please wrap your samples/codes in CODE TAGS,... (3 Replies)