What is the maximum no. of arguments that could be passed to a shell script ? Is there any restriction ?
I've a requirement where I need to pass a list of names to a unix script and I guess the number of such names is not a fixed one. It can run into hundreds.
Is this feasible ? (4 Replies)
Hi Experts,
I have a file as given below and want to filter out the filenames in it , by deleting left and right filds and to have the fllenames (There are spaces in the filename),
Sun Jan 11 11:20:10 2009 1 0 /home/output/file2311_recent.list user1 user2 0 done
Sun Jan 11 11:20:10 2009 1 0... (10 Replies)
Hi all ,
I have a view in teradata , the ouput of that view have to be stored as a file with delimitere as '|'.Is there any possibility of doing this in unix ?
Thanks in advance ,
Vinoth (6 Replies)
Hi ,
I have a script that is causing a problem that led me to think if there is a limit to the number of arguments for 'set' command in csh shell script.
Here is my script:
#!/bin/csh -f
set top = design_top
#1
set v_mbist = ( sim_mbist/*.v )
#2
set v_simlist = ( -v... (2 Replies)
How can i remove a file using shell script when its size exceeds 10MB. Given that file is located in different location to the shell script where it is running? (4 Replies)
I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients).
I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Hi all
The following code will update the Dynamic DNS server at Namecheap.com.
wget -O 'https://dynamicdns.park-your-domain.com/update?host=www&domain=example.com&password=your DDNS password'Would like to append the output to a log file using >> /path/path/logfile at the end of the command.
... (7 Replies)
Hallo Team,
I would like to redirect an output from a file into another file. Here are the two commands/files.
-bash-3.2$ cat lack.csv
lemontwistpax
-bash-3.2$ ll -ltr BW*|tail -1
-rw-r--r-- 1 mind mind 1844 Sep 25 12:06... (8 Replies)
Hello Lads,
I deployed a script on my mac to start and stop EC2 instances on AWS console. The script when started manually on the terminal does the expected stop and start. Problem is when i try to schedule it on a cron, it fails to recognize the AWS Keys which i set up as ENV variable by... (2 Replies)
Hi All,
I am trying to print all the packages info in solaris 11 using below script.
#!/usr/bin/env bash
pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}' > /tmp/cp1
/usr/bin/nawk -F: '
{for (i=1; i<=NF; i++) {gsub (/^ *| *$/, "", $i)
... (5 Replies)
Discussion started by: sravani25
5 Replies
LEARN ABOUT OSX
rotatelogs
ROTATELOGS(8) rotatelogs ROTATELOGS(8)NAME
rotatelogs - Piped logging program to rotate Apache logs
SYNOPSIS
rotatelogs [ -l ] [ -f ] logfile rotationtime|filesizeM [ offset ]
SUMMARY
rotatelogs is a simple program for use in conjunction with Apache's piped logfile feature. It supports rotation based on a time interval or
maximum size of the log.
OPTIONS -l Causes the use of local time rather than GMT as the base for the interval or for strftime(3) formatting with size-based rotation.
Note that using -l in an environment which changes the GMT offset (such as for BST or DST) can lead to unpredictable results!
-f Causes the logfile to be opened immediately, as soon as rotatelogs starts, instead of waiting for the first logfile entry to be read
(for non-busy sites, there may be a substantial delay between when the server is started and when the first request is handled,
meaning that the associated logfile does not "exist" until then, which causes problems from some automated logging tools). Available
in version 2.2.9 and later.
logfile
rotationtime
The time between log file rotations in seconds. The rotation occurs at the beginning of this interval. For example, if the rotation
time is 3600, the log file will be rotated at the beginning of every hour; if the rotation time is 86400, the log file will be
rotated every night at midnight. (If no data is logged during an interval, no file will be created.)
filesizeM
The maximum file size in megabytes followed by the letter M to specify size rather than time.
offset The number of minutes offset from UTC. If omitted, zero is assumed and UTC is used. For example, to use local time in the zone UTC
-5 hours, specify a value of -300 for this argument. In most cases, -l should be used instead of specifying an offset.
EXAMPLES
CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common
This creates the files /var/logs/logfile.nnnn where nnnn is the system time at which the log nominally starts (this time will always be a
multiple of the rotation time, so you can synchronize cron scripts with it). At the end of each rotation time (here after 24 hours) a new
log is started.
CustomLog "|bin/rotatelogs -l /var/logs/logfile.%Y.%m.%d 86400" common
This creates the files /var/logs/logfile.yyyy.mm.dd where yyyy is the year, mm is the month, and dd is the day of the month. Logging will
switch to a new file every day at midnight, local time.
CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common
This configuration will rotate the logfile whenever it reaches a size of 5 megabytes.
ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"
This configuration will rotate the error logfile whenever it reaches a size of 5 megabytes, and the suffix to the logfile name will be cre-
ated of the form errorlog.YYYY-mm-dd-HH_MM_SS.
PORTABILITY
The following logfile format string substitutions should be supported by all strftime(3) implementations, see the strftime(3) man page for
library-specific extensions.
o %A - full weekday name (localized)
o %a - 3-character weekday name (localized)
o %B - full month name (localized)
o %b - 3-character month name (localized)
o %c - date and time (localized)
o %d - 2-digit day of month
o %H - 2-digit hour (24 hour clock)
o %I - 2-digit hour (12 hour clock)
o %j - 3-digit day of year
o %M - 2-digit minute
o %m - 2-digit month
o %p - am/pm of 12 hour clock (localized)
o %S - 2-digit second
o %U - 2-digit week of year (Sunday first day of week)
o %W - 2-digit week of year (Monday first day of week)
o %w - 1-digit weekday (Sunday first day of week)
o %X - time (localized)
o %x - date (localized)
o %Y - 4-digit year
o %y - 2-digit year
o %Z - time zone name
o %% - literal `%'
Apache HTTP Server 2010-11-06 ROTATELOGS(8)