Hi,
I want to write bash script that will keep on looking for files in a directory and if any file exists, it processes them. I want it to be a background process, which keeps looking for files in a directory.
Is there any way to do that in bash script?
I can loop through all the files like... (4 Replies)
hello
i have a requirement where i have a direcotry in which i get files in the format
STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat
i need to loop through the directory and sort by create date descending order and i need to process the first file.
... (1 Reply)
Hi all,
Can somebody help me with this problem pls.
I need to extract one specific line from each files in a folder and put
the all lines extracted in a unique output file in the following format.
line extracted, respective name of file, date of file.
I´m, trying the part to extract... (3 Replies)
Hi,
I am new to unix and shell scripting,can anybody help me in sctipting a requirement.
my requirement is to get the latest directory the name of the directory will be like CSB.monthdate_time stamp
like CSB.Sep29_11:16 and CSB.Oct01_16:21.
i need to pick the latest directory.
in the... (15 Replies)
I was looking to get some help with copying files in one directory to another using a for-in loop. My script file is called copyfile and here is what I have:
for file in $(ls -a $1)
do
cp $file ~/dir-2
done
When I run copyfile dir-1 this is what I get
cp: omitting directory `.'... (1 Reply)
Hi,
I would like to write a loop to change the names of files in a directory. The files are called data1.txt through data1000.txt. I'd like to change their names to a1.txt through a1000.txt. How do I go about doing that? Thanks! (2 Replies)
Hello
How do I loop through files in a specific directory ?
This script is not working!
#! /bin/bash
FILES=/usr/desktop/input/*
For f in $FILES;
do
awk '-v A="$a" -v B="$b" {$6=($1-64)/2 ;$7=((10^($6/10))/A)^(1/B) ; print}' OFS="\t" $f > /root/Desktop/output/$f.txt;
done
... (7 Replies)
I am trying to loop through files in a directory, and sort each file. No matter what changes I make to the code, I get the following errors:
'aunch.sh: line 4: syntax error near unexpected token `do
'aunch.sh: line 4: `for f in ${FILES}/*; do
#!/bin/bash
FILES=$(pwd)
for f in ${FILES}/*;... (1 Reply)
I am trying to loop through files in a directory, and sort each file. No matter what changes I make to the code, I get the following errors:
'aunch.sh: line 4: syntax error near unexpected token `do
'aunch.sh: line 4: `for f in ${FILES}/*; do
#!/bin/bash
FILES=$(pwd)
for f in ${FILES}/*;... (6 Replies)
I have one question.
On the directory I have many files start with
DB.DAILYxxxxxxx.YYYYMMDD.HHMMSS
and I have several files with other format, like
LET.20170310
daily.20170310
tba.20170310
How can I exclude from my loop DB.DAILY files?
I tried
ls *20170310* | while read... (4 Replies)
Discussion started by: digioleg54
4 Replies
LEARN ABOUT DEBIAN
bind::config::parser
BIND::Config::Parser(3pm) User Contributed Perl Documentation BIND::Config::Parser(3pm)NAME
BIND::Config::Parser - Parse BIND Config file.
SYNOPSIS
use BIND::Config::Parser;
# Create the parser
my $parser = new BIND::Config::Parser;
my $indent = 0;
# Set up callback handlers
$parser->set_open_block_handler( sub {
print " " x $indent, join( " ", @_ ), " {
";
$indent++;
} );
$parser->set_close_block_handler( sub {
$indent--;
print " " x $indent, "};
";
} );
$parser->set_statement_handler( sub {
print " " x $indent, join( " ", @_ ), ";
";
} );
# Parse the file
$parser->parse_file( "named.conf" );
DESCRIPTION
BIND::Config::Parser provides a lightweight parser to the configuration file syntax of BIND v8 and v9 using a "Parse::RecDescent" grammar.
It is in a similar vein to "BIND::Conf_Parser". However, as it has no knowledge of the directives, it doesn't need to be kept updated as
new directives are added, it simply knows how to carve up a BIND configuration file into logical chunks.
CONSTRUCTOR
new( );
Create a new "BIND::Config::Parser" object.
METHODS
set_open_block_handler( CODE_REF );
Set the code to be called when a configuration block is opened. At least one argument will be passed; the name of that block, for
example "options" or "zone", etc. as well as any additional items up to but not including the opening curly brace.
set_close_block_handler( CODE_REF );
Set the code to be called when a configuration block is closed. No arguments are passed.
set_statement_handler( CODE_REF );
Set the code to be called on a single line configuration element. At least one argument will be passed; the name of that element, as
well as any additional items up to but not including the ending semi-colon.
parse_file( FILENAME );
Parse FILENAME, triggering the above defined handlers on the relevant sections.
TODO
Probably the odd one or two things. I'm fairly sure the grammar is correct.
COPYRIGHT AND LICENSE
Copyright (c) 2005 Matt Dainty.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHORS
Matt Dainty <matt@bodgit-n-scarper.com>.
SEE ALSO
perl, Parse::RecDescent, BIND::Conf_Parser.
perl v5.14.2 2005-06-26 BIND::Config::Parser(3pm)