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 have written a script to read the file line by line.
It is reading and printing the lines.
But it is coming out of loop before reading last line.
So I am not able to print last line.
How do I solve it. (6 Replies)
Hi,
For my reuirement, I have to read a file from the 2nd line till the last line<EOF>.
Say,
I have a file as test.txt, which as a header record in the first line followed by records in rest of the lines.
for i in `cat test.txt`
{
echo $i
}
While doing the above loop, I have read... (5 Replies)
Hi Guys
I am new to scripting.Please forgive for asking basic questions.
I want to write a script to check whether the logs are getting updated in last 15 mins.
cat server
192.168.1.6
192.168.1.7
cat list
192.168.1.7 /logs/logpath1
192.168.1.7 /logs/logpath2
192.168.1.6... (4 Replies)
Hi, I have multiple large files which consist of the below format:
I am trying to write an awk or sed script to remove all occurrences of the 00 record except the first and remove all of the 80 records except the last one.
Any help would be greatly appreciated. (10 Replies)
Hi,
I want to read a live log file line by line and considering those line which are newly added to file
Below code I am using, which read line but as soon as it read new line from log file its starts processing from very first line of file.
tail -F /logs/COMMON-ERROR.log | while read... (11 Replies)
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Hello,
I'm using RHEL 5.1 with bash. How to handle "read" inside while loop reading every line? Please see below:
# cat /tmp/passwd_sample
CARRJ12:qVSn4ja4mFA72,..:20021:125:JULIAN CARR:/home/everyone:/bin/bash
HERCOT01:NK/3j2ZB4ZC7Q:20022:125:TOM HERCOCK:/home/everyone:/bin/bash... (4 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
ysh
YSH(1p) User Contributed Perl Documentation YSH(1p)NAME
ysh - The YAML Test Shell
SYNOPSIS
ysh [options]
DESCRIPTION
This program is designed to let you play with the Perl YAML modules in an interactive way. When you to type in Perl, you get back YAML. And
vice versa.
By default, every line you type is a one line Perl program, the return value of which will be displayed as YAML.
To enter multi-line Perl code start the first line with ';' and use as many lines as needed. Terminate with a line containing just ';'.
To enter YAML text, start with a valid YAML separator/header line which is typically '---'. Use '===' to indicate that there is no YAML
header. Enter as many lines as needed. Terminate with a line containing just '...'.
To read in and process an external YAML file, enter '< filename'. The ysh will also work as a standalone filter. It will read anything on
STDIN as a YAML stream and write the Perl output to STDOUT. You can say (on most Unix systems):
cat yaml.file | ysh | less
COMMAND LINE OPTIONS
-MYAML::Module
Set the YAML implementation module you wish.
-l Keep a log of all ysh activity in './ysh.log'. If the log file already exists, new content will be concatenated to it.
-L Keep a log of all ysh activity in './ysh.log'. If the log file already exists, it will be deleted first.
-r Test roundtripping. Every piece of Perl code entered will be Dumped, Loaded, and Dumped again. If the two stores do not match, an error
message will be reported.
-R Same as above, except that a confirmation message will be printed when the roundtrip succeeds.
-i<number>
Specify the number of characters to indent each level. This is the same as setting $YAML::Indent.
-ub Shortcut for setting '$YAML::UseBlock = 1'. Force multiline scalars to use 'block' style.
-uf Shortcut for setting '$YAML::UseFold = 1'. Force multiline scalars to use 'folded' style.
-uc Shortcut for setting '$YAML::UseCode = 1'. Allows subroutine references to be processed.
-nh Shortcut for setting '$YAML::UseHeader = 0'.
-nv Shortcut for setting '$YAML::UseVersion = 0'.
-v Print the versions of ysh and the YAML implementation module in use.
-V In addition to the -v info, print the versions of YAML related modules.
-h Print a help message.
YSH_OPT
If you don't want to enter your favorite options every time you enter ysh, you can put the options into the "YSH_OPT" environment variable.
Do something like this:
export YSH_OPT='-i3 -uc -L'
SEE ALSO
YAML
AUTHOR
Ingy doet Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2006, 2008. Ingy doet Net.
Copyright (c) 2001, 2002. Brian Ingerson.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
perl v5.10.1 2008-12-01 YSH(1p)