Hello,
I try to write a shell script that would list all files on a directory and stop when it finds the first item specified on a find or ls command.
How can I tell to the find or ls command to stop when it finds the first ".doc" file for example ?
Thank you (7 Replies)
Okay, I have two scripts, the first one does some stuff, and comes to a point where it has this:
Right here it runs a quick script to start something that writes to a log file.
/usr/bin/tail -f ${pathVar}/nohup_${servVar}.out |
while read -r line
do
] && continue
cd ${pathVar}... (0 Replies)
CPAN.pm: Going to build G/GA/GAAS/Unicode-String-2.09.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Unicode::String
cp String.pm blib/lib/Unicode/String.pm
cp lib/Unicode/CharName.pm blib/lib/Unicode/CharName.pm
/usr/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp... (5 Replies)
Hi guys i am tailing a constantly appending log file. However, I am looking for some specific word to be seen only when there is an update.
How should I look for the word "{test-0101}" in tail, so that it only shows when there is a line that contains {test-0101} ?
Thanks (1 Reply)
Hi all,
I have a question..
Here is my requirement..I have 500 files in a path say /a/b/c
I have some numbers in a file which are comma seperated...and I wanted to check if the numbers are present in the FileName in the path /a/b/c..if the number is there in the file that is fine..but if... (1 Reply)
Hello Everyone,
I just started scripting this week. I have no background in programming or scripting.
I'm working on a script to grep for a variable in a log file
Heres what the log file looks like. The x's are all random clutter
xxxxxxxxxxxxxxxxxxxxx START: xxxxxxxxxxxx... (7 Replies)
Hi,
I have two variables x and y.
i need to find a particular string in a file, a workflow name and then insert the values of x and y into the next lines of the workflow name.
basically it is like as below
wf_xxxxxx
$$a=
$$b=
$$c= figo
$$d=bentley
i need to grep the 'wf_xxxx' and then... (6 Replies)
Right now, my code is:
s/Secondary Ins./Secondary Ins.\
1/g
It's adding a 1 as soon as it finds Secondary Ins.
Primary Ins.: MEDICARE B DMERC Secondary Ins.
1: CONTINENTAL LIFE INS
What I really want to achieve is having a 1 added on the next line that contain "Secondary Ins." It... (4 Replies)
say i have a statement like this in a script
tail -f /opt/blah/blha/user.log > final.log
if ;then
cat final.log | grep -i "servicer_user" > service.log
cat final.log | grep -i "logic_user" > logic.log
fi
echo "script completed"
but when the script is running if i press ctrl + c the... (4 Replies)
i want to search a log for a string. when that string is found, i want to grab the a set number of lines that came before the string, and a set number of lines that come after the string.
so if i search for the word "Error" in the /var/log/messages file, how can I output the 20 lines that came... (4 Replies)
Discussion started by: SkySmart
4 Replies
LEARN ABOUT PLAN9
tail
TAIL(1) General Commands Manual TAIL(1)NAME
tail - deliver the last part of a file
SYNOPSIS
tail [ +-number[lbc][rf] ] [ file ]
tail [ -fr ] [ -n nlines ] [ -c ncharacters ] [ file ]
DESCRIPTION
Tail copies the named file to the standard output beginning at a designated place. If no file is named, the standard input is copied.
Copying begins at position +number measured from the beginning, or -number from the end of the input. Number is counted in lines, 1K
blocks or characters, according to the appended flag or Default is -10l (ten ell).
The further flag causes tail to print lines from the end of the file in reverse order; (follow) causes tail, after printing to the end, to
keep watch and print further data as it appears.
The second syntax is that promulgated by POSIX, where the numbers rather than the options are signed.
EXAMPLES
tail file
Print the last 10 lines of a file.
tail +0f file
Print a file, and continue to watch data accumulate as it grows.
sed 10q file
Print the first 10 lines of a file.
SOURCE
/sys/src/cmd/tail.c
BUGS
Tails relative to the end of the file are treasured up in a buffer, and thus are limited in length.
According to custom, option +number counts lines from 1, and counts blocks and characters from 0.
TAIL(1)