Hi,
I am a beginner in shell scripting. I have written the following script, which is supposed to process the while loop for each line in the sid_home.txt file. But I'm getting the 'end of file' unexpected for the last line. The file sid_home.txt gets generated as expected, but the script... (6 Replies)
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
I know how to read a file line by line. But don't to how to skip to a line matching a criteria and then continue reading it till the end.
This is a log file. The input is a timestamp.
1. Find the timestamp in the log file
2. Read the remaining lines one at a time till EOF.
How can I do... (9 Replies)
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
Hi,
I want to read a live log file line by line and considering those line which start from time stamp;
Below code I am using, which read line but throws an exception when comparing line that does not contain error code
tail -F /logs/COMMON-ERROR.log | while read myline; do... (2 Replies)
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Hi All,
I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise
My intention is to insert a line of text after 13th line of every file inside a particular directory.
While trying to do it for a single file , i am using sed
sed '3 i this is the 4th line' filename
sed: command garbled: 3... (5 Replies)
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
LEARN ABOUT DEBIAN
test::tempdir
Test::TempDir(3pm) User Contributed Perl Documentation Test::TempDir(3pm)NAME
Test::TempDir - Temporary files support for testing.
SYNOPSIS
use Test::TempDir;
my $test_tempdir = temp_root();
my ( $fh, $file ) = tempfile();
my $directory_scratch_obj = scratch();
DESCRIPTION
Test::TempDir provides temporary directory creation with testing in mind.
The differences between using this and using File::Temp are:
o If "t/tmp" is available (writable, creatable, etc) it's preferred over $ENV{TMPDIR} etc. Otherwise a temporary directory will be used.
This is "temp_root"
o Lockfiles are used on "t/tmp", to prevent race conditions when running under a parallel test harness.
o The "temp_root" is cleaned at the end of a test run, but not if tests failed.
o "temp_root" is emptied at the begining of a test run unconditionally.
o The default policy is not to clean the individual "tempfiles" and "tempdirs" within "temp_root", in order to aid in debugging of failed
tests.
EXPORTS
temp_root
The root of the temporary stuff.
tempfile
tempdir
Wrappers for the File::Temp functions of the same name.
The default options are changed to use "temp_root" for "DIR" and disable "CLEANUP", but these are overridable.
scrach
Loads Directory::Scratch and instantiates a new one, with the same default options as "tempfile" and "tempdir".
SEE ALSO
File::Temp, Directory::Scratch, Path::Class
VERSION CONTROL
This module is maintained using Git. You can get the latest version from <git://github.com/nothingmuch/test-tempdir.git>.
AUTHOR
Yuval Kogman <nothingmuch@woobling.org>
COPYRIGHT
Copyright (c) 2008 Yuval Kogman. All rights reserved
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2009-08-11 Test::TempDir(3pm)