I'm looking for a way to generate an error when a command does not print an expected message. For example :
test.sh : test.exp :
I expected test.exp to match the string "hi!" but it turns out that an empty string is matched first (printed in blue) :
I tried some alternatives like first clearing the expect buffer with `expect "*"` or matching it with `expect ""`, etc. but the empty string is not deleted. Any suggestions?
Hi
I use sed in a script for severall changes in files. I whish one of the substitutions I made to be aplied to every line that has the word "scripts" with the exception for the ones that start with "rsh", wich I wish sed to ignore . Is this possible? If yes, how can I do it?
The substitution... (2 Replies)
Is there a standard way to make a shell script read a file, or list, and skip each line that contains # at the begining, or ignores the content starting after a # in line?
I'm looking to mimic the way commenting in a shell script normally works. This way I can comment my text files and lists my... (4 Replies)
From the below file I want to grep only the lines except the comment sections. But grep -v "#" is eliminating the last line because it has one # in between.
Any idea how can I ignore only the lines which have # at the begining (I mean comment lines) ?
Thanks a lot to all in advance
C Saha (1 Reply)
Is there a way to tell awk to ignore the first 11 lines of a file?? example, I have a csv file with all the heading information in the first lines. I want to split the file into 5-6 different files but I want to retain the the first 11 lines of the file.
As it is now I run this command:
... (8 Replies)
Hello Experts,
I have two files called "old" and "new". My old file contains 10 lines and my new file contains 10 + "n" lines.
The first field in both these files contain ID. I sort these two files on ID. I am interested in only the lines that are in the new file and not in old.
I tried... (4 Replies)
Hi,
Please provide shell script to Remove empty lines(space) between two lines containing strings in a file.
Input File :
A1/EXT "BAP_BSC6/07B/00" 844 090602 1605
RXOCF-465 PDTR11 1
SITE ON BATTERY
A2/EXT... (3 Replies)
Hi,
i am having one text file it contains some blank lines and i want to ignore that blank lines .
#! /bin/bash
clear
rdCount=0;
while read myline
do
echo $myline
let rdCount=$rdCount+1
done < ps.txt
echo "Total line=$rdCount"
and ps .txt contains the data- (17 Replies)
Hi,
I have a shell script, which reads a *.txt file - line by line. In this text file, I have some lines beginning with "#" that I want to ignore :
MY_FILE
#blah blah blah 1
blah blah blah 2
blah blah blah 3
#blah blah blah 4
I want my script to read only the following lines... (3 Replies)
Hi - I have req to join broken lines and remove empty lines but should NOT be in one line. It has to be as is line by line. The challenge here is there is no end of line/start of line char.
thanks in advance
Source:-
2003-04-34024|04-10-2003|Claims|Claim|01-13-2003|Air Bag:Driver;... (7 Replies)
Discussion started by: Jackceasar123
7 Replies
LEARN ABOUT DEBIAN
bb-services
BB-SERVICES(5) File Formats Manual BB-SERVICES(5)NAME
bb-services - Configuration of TCP network services
SYNOPSIS
$BBHOME/etc/bb-services
DESCRIPTION
bb-services contains definitions of how bbtest-net(1) should test a TCP-based network service (i.e. all common network services except HTTP
and DNS). For each service, a simple dialogue can be defined to check that the service is functioning normally, and optional flags deter-
mine if the service has e.g. a banner or requires SSL- or telnet-style handshaking to be tested.
FILE FORMAT
bb-services is a text file. A simple service definition for the SMTP service would be this:
[smtp]
send "mail
quit
"
expect "220"
options banner
This defines a service called "smtp". When the connection is first established, bbtest-net will send the string "mail
quit
" to the
service. It will then expect a response beginning with "220". Any data returned by the service (a so-called "banner") will be recorded and
included in the status message.
The full set of commands available for the bb-services file are:
[NAME] Define the name of the TCP service, which will also be the column-name in the resulting display on the test status. If multiple
tests share a common definition (e.g. ssh, ssh1 and ssh2 are tested identically), you may list these in a single "[ssh|ssh1|ssh2]"
definition, separating each service-name with a pipe-sign.
send STRING
expect STRING
Defines the strings to send to the service after a connection is established, and the response that is expected. Either of these may
be omitted, in which case bbtest-net(1) will simply not send any data, or match a response against anything.
The send- and expect-strings use standard escaping for non-printable characters. "
" represents a carriage-return (ASCII 13), "
"
represents a line-feed (ASCII 10), " " represents a TAB (ASCII 8). Binary data is input as "xNN" with NN being the hexadecimal
value of the byte.
port NUMBER
Define the default TCP port-number for this service. If no portnumber is defined, bbtest-net(1) will attempt to lookup the portnum-
ber in the standard /etc/services file.
options option1[,option2][,option3]
Defines test options. The possible options are
banner - include received data in the status message
ssl - service uses SSL so perform an SSL handshake
telnet - service is telnet, so exchange telnet options
FILES
$BBHOME/etc/bb-services
SEE ALSO bbtest-net(1)Xymon Version 4.2.3: 4 Feb 2009 BB-SERVICES(5)