Sponsored Content
Top Forums Shell Programming and Scripting convert the below perl sript to shell script Post 302181932 by mail2sant on Friday 4th of April 2008 01:22:04 PM
Old 04-04-2008
convert the below perl sript to shell script

perl script:

my $logdir = '/smp/dyn/logfiles/fsm/mp/mp';
$logdir = $logdir ."/mp${toDate}*";


i tried to make it..as below .. but not working ..

date +%m%d%y
logdir = /smp/dyn/logfiles/fsm/mp/mp
logdir=$logdir/mp"$date"

but it was not working.....
can someone please help me out in this..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Sript - Spell Checker Assign

Hi Folks. I am currently working on a script that has to spell check a file and print the output to the screen in 2 columns like this. INCORRECT CORRECTION whio who weahter weather The file will allow the user to override the ispell command and save any... (9 Replies)
Discussion started by: ccfc1986
9 Replies

2. UNIX for Dummies Questions & Answers

Shell Sript

Hi All, I have four different files in four different directories. Each file contains exactly the same format logincode Forename Surname TutGroup Mark Basically i want to grab all the marks from each file and put them onto the end of one login code by using a shell script. I can grab all... (3 Replies)
Discussion started by: jazz8146
3 Replies

3. Shell Programming and Scripting

convert PERL script to SHELL script

Hi all experts, I am new to Unix. Could you please help me to convert the following PERL script to SHELL? I will appreciate. #!/bin/sh use strict; use warnings; my $robot_num = 0; my %rob_tapes; foreach (`/usr/openv/volmgr/bin/vmquery -l -rn $robot_num`) { $rob_tapes{(split)} = 1; }... (6 Replies)
Discussion started by: ma466
6 Replies

4. Shell Programming and Scripting

Shell/Perl script to convert to Capitalize case

I need a shell script which will convert the given string within a <title> tag to Capitalize case. E.g "<title>hi man: check this out</title>" to "<title>Hi Man: Check This Out</title>" (11 Replies)
Discussion started by: parshant_bvcoe
11 Replies

5. Shell Programming and Scripting

convert perl code to shell script

This is about how to Monitoring folder for new files using shell script im doing a project using smsserver tools 3. i have used a perl script to handle incoming messages. the content of each message must be directed to a java program. this program generates the answer to reply to the user... (2 Replies)
Discussion started by: x34
2 Replies

6. Shell Programming and Scripting

Help: how to convert perl script to shell script

bash$ mdb-schema x.mdb | perl -wpe 's%^DROP TABLE %DROP TABLE IF EXISTS %i; s%(Memo/Hyperlink|DateTime( \(Short\))?)%TEXT%i; s%(Boolean|Byte|Byte|Numeric|Replication ID|(\w+ )?Integer)%INTEGER%i; s%(BINARY|OLE|Unknown (+)?)%BLOB%i; s%\s*\(\d+\)\s*(,?*)$%${1}%;' | sqlite3 x.db ... (1 Reply)
Discussion started by: jackpapa
1 Replies

7. Shell Programming and Scripting

compare dates using shell sript

I have 2 date feilds 2011-05-13:18:45 2011-05-13:18:30 I need to compare them and say its OK/NOK I tried this but dint work. systime=2011-05-13:18:45 shubtime=2011-05-13:18:30 if then echo" OK" else echo "NOK" fi In this its not same so the o/p should be NOK (2 Replies)
Discussion started by: LavanyaP
2 Replies

8. Shell Programming and Scripting

HELP on Perl array / sorting - trying to convert Korn Shell Script to Perl

Hi all, Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM. Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers. At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies

9. Shell Programming and Scripting

Convert shell script to Perl

Hello,,I have a very small script that contains these lines; and it works perfectly; however I need to use Perl now as I will need to feel variables from a MySQL table into this; to it would be nice to start by converting this first... find / -perm 777 \( -type f -o -type d \) -exec ls -lid {}... (1 Reply)
Discussion started by: gvolpini
1 Replies

10. Shell Programming and Scripting

Perl to shell convert

HI All, I am new in shell scripting ,can any one please help me to convert this scripts from Perl to Shell. Thank in advance. $customer=$ARGV; $rows=`hadoop fs -ls /ncip/$customer/|wc -l`; if($rows==3){ print "$customer directory exists , cleaning up ! \n"; `hadoop fs -rm... (1 Reply)
Discussion started by: Atul301
1 Replies
appender_type_rollingfile.h(3)					       log4c					    appender_type_rollingfile.h(3)

NAME
appender_type_rollingfile.h - Log4c rolling file appender interface. SYNOPSIS
#include <log4c/defs.h> #include <log4c/appender.h> #include <log4c/rollingpolicy.h> Functions LOG4C_API rollingfile_udata_t * rollingfile_make_udata (void) LOG4C_API int rollingfile_udata_set_logdir (rollingfile_udata_t *rfudatap, char *logdir) LOG4C_API int rollingfile_udata_set_files_prefix (rollingfile_udata_t *rfudatap, char *prefix) LOG4C_API int rollingfile_udata_set_policy (rollingfile_udata_t *rfudatap, log4c_rollingpolicy_t *policyp) LOG4C_API const char * rollingfile_udata_get_logdir (rollingfile_udata_t *rfudatap) LOG4C_API const char * rollingfile_udata_get_files_prefix (rollingfile_udata_t *rfudatap) LOG4C_API long rollingfile_get_current_file_size (rollingfile_udata_t *rfudatap) Variables __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_rollingfile Detailed Description Log4c rolling file appender interface. The rolling file appender implements a logging mechanism of a list of files up to a maximum number. The files are written by default to the current directory with logging names folowing the pattern log.1, log.2 etc. These parameters may be changed using the appropriate setter functions. If the appender fails to open logfiles for writing then the messages are logged to stderr--it will continue to try to open the zero-th file for writing at rollover events so if it succeeds at some point to open that file the messages will start to appear therein and will no longer be sent to stderr. Switching from logging from one file to the next is referred to as a 'rollover event'. The policy that determines when a rollover event should happen is called a 'rolling policy'. A mechanism is provided to allow different rolling policies to be defined. Log4c ships with (and defaults to) the classic size-window rollover policy: this triggers rollover when files reach a maximum size. The first file in the list is always the current file; when a rollover event occurs files are shifted up by one position in the list--if the number of files in the list has already reached the max then the oldest file is rotated out of the window. See the documentation in the rollingpolicy_type_sizewin.h file for more details on the size-win rollover policy. Function Documentation LOG4C_API long rollingfile_get_current_file_size (rollingfile_udata_t *rfudatap) Get the prefix string in this rolling file appender configuration. Parameters: rfudatap the rolling file appender configuration object. Returns: the current size of the file being logged to. LOG4C_API rollingfile_udata_t* rollingfile_make_udata (void) Get a new rolling file appender configuration object. Returns: a new rolling file appender configuration object, otherwise NULL. LOG4C_API const char* rollingfile_udata_get_files_prefix (rollingfile_udata_t *rfudatap) Get the prefix string in this rolling file appender configuration. Parameters: rfudatap the rolling file appender configuration object. Returns: the prefix. LOG4C_API const char* rollingfile_udata_get_logdir (rollingfile_udata_t *rfudatap) Get the logging directory in this rolling file appender configuration. Parameters: rfudatap the rolling file appender configuration object. Returns: the logging directory. LOG4C_API int rollingfile_udata_set_files_prefix (rollingfile_udata_t *rfudatap, char *prefix) Set the prefix string in this rolling file appender configuration. Parameters: rfudatap the rolling file appender configuration object. prefix the logging files prfix to use. Returns: zero if successful, non-zero otherwise. LOG4C_API int rollingfile_udata_set_logdir (rollingfile_udata_t *rfudatap, char *logdir) Set the logging directory in this rolling file appender configuration. Parameters: rfudatap the rolling file appender configuration object. logdir the logging directory to set. Returns: zero if successful, non-zero otherwise. LOG4C_API int rollingfile_udata_set_policy (rollingfile_udata_t *rfudatap, log4c_rollingpolicy_t *policyp) Set the rolling policy in this rolling file appender configuration. Parameters: rfudatap the rolling file appender configuration object. policyp the logging files prfix to use. Returns: zero if successful, non-zero otherwise. Variable Documentation __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_rollingfile rollingfile appender type definition. This should be used as a parameter to the log4c_appender_set_type() routine to set the type of the appender. Author Generated automatically by Doxygen for log4c from the source code. Version 1.2.1 Mon May 2 2011 appender_type_rollingfile.h(3)
All times are GMT -4. The time now is 02:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy