Sponsored Content
Full Discussion: Test function not working
Top Forums Shell Programming and Scripting Test function not working Post 302795785 by oahmad on Thursday 18th of April 2013 10:57:19 AM
Old 04-18-2013
Code:
bash$ echo "$line" | od -c
0000000 # a n a l o g \n
0000011
bash$

---------- Post updated at 10:57 AM ---------- Previous update was at 10:45 AM ----------

i found my problem! My text file had a \n at the end. that was being compared...since this is a non-printable asci character, i did not see the problem when i was printing it out. Thanks for teh suggestion of using the od command....just curious what do 0000000 and 0000011 mean?

Last edited by oahmad; 04-18-2013 at 11:49 AM.. Reason: wrong command, forgot the $
 

10 More Discussions You Might Find Interesting

1. Programming

C function to test string or integer

Hi everyone , Is there any predefined C function that tests whether an input is string or an integer? Thank's in advance :) (3 Replies)
Discussion started by: qqq
3 Replies

2. Shell Programming and Scripting

function to test if file is open

I need to write a function that will work in sh/ksh shell that will test to see if a file has already been opened for writting by another user has anyone written something like this? (3 Replies)
Discussion started by: johnsonbryce
3 Replies

3. Shell Programming and Scripting

test command is not working

#!/bin/ksh size=3978132853 limit=100 if ;then echo exceeded limit fi This does not work though if i reduce 3978132853 to 397813285 it works any ideas and work around appreciated (SunOS 5.9 Generic_117171-02 sun4u sparc SUNW,Ultra-80 ) (2 Replies)
Discussion started by: zam
2 Replies

4. Programming

C function to test existence of a login

Hi everybody, I need to check in C program whether a given login is known on the system. Is there any system function that could do this ? So far, all I could find is getpwnam(), which answers my problem by parsing the local password database. But won't work if a user is authenticated by... (2 Replies)
Discussion started by: xavier054
2 Replies

5. UNIX for Advanced & Expert Users

test for function name?

Hi, I found this: https://www.unix.com/unix-advanced-expert-users/27318-how-see-function-shell.html which indicates I can use typeset -f to list the functions. But it also lists the contents of the functions. Is there a lighter weight way to see what is defined? Is there an internal... (5 Replies)
Discussion started by: duderonomy
5 Replies

6. Solaris

How i test the UDP port is working?

Hi anybody know how to test out the UDP port working? cos UDP cannot use telnet to test... Sumemr (2 Replies)
Discussion started by: summerpeh
2 Replies

7. Shell Programming and Scripting

explanation of test function

I have found a code some where, which looks like if (test $value) then <do something> fi I am not understanding what is test doing here. I have seen test with !,-eq, -e etc. But, the above appears to be a new one to me. Can anyone please expalin me. (4 Replies)
Discussion started by: mady135
4 Replies

8. UNIX for Advanced & Expert Users

if and test not working

All, I am getting error when run file check with test operator . Why is it showing the error if then echo 'file found' fi ksh: -r: unknown test operator I know i can use the below code to test the file but why the above is not working if test -r filename ... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

9. UNIX for Advanced & Expert Users

Test -e not working as expected (by me)

I ran into the following and still do not understand entirely the rationale behind this. If someone could explain why things are as they are I'd be thankful. The following was tested on AIX 7.1 with ksh88, but i suspect that to be ubiquitous. In an installation routine i had to create a set of... (6 Replies)
Discussion started by: bakunin
6 Replies

10. Shell Programming and Scripting

Wrong test interpretation for simple function.

Hello everyone, I have written simple script below to check if ip is added to interface #!/usr/local/bin/bash IFCONFIG="/sbin/ifconfig" SERVICE="/usr/sbin/service" IP="79.137.X.X" GREP=$(${IFCONFIG} | grep ${IP}) ip_quantity_check () { echo ${GREP} | wc -l } if ];... (2 Replies)
Discussion started by: bryn1u
2 Replies
analog(1)						      General Commands Manual							 analog(1)

NAME
analog - web server logfile analyser SYNOPSIS
analog --help analog [(-|+)1] [(-|+)4] [(-|+)5] [(-|+)6] [(-|+)7] [(-|+)A] [(-|+)a] [-B|+B[options]] [-b|+b[options]] [(-|+)C'configuration-line'] [-c|+c[options]] [(-|+)D] [(-|+)d] [-E|+E[options]] [-F|+Fdate] [-f|+f[options]] [-G] [+gfilename] [(-|+)H] [(-|+)h] [-I|+I[options]] [-i|+i[options]] [-J|+J[options]] [-j|+j[options]] [-K|+K[options]] [-k|+k[options]] [-L|+L[options]] [-l|+l[options]] [-M|+M[options]] [(-|+)m] [-N|+N[options]] [-n|+n[options]] [+Ooutput-file] [-o|+o[options]] [(-|+)P] [-p|+p[options]] [(-|+)Q] [-q|+q[[-|+]types]] [-R|+R[options]] [-r|+r[options]] [-S|+S[options]] [(-|+)S] [-T|+Tdate] [-t|+t[options]] [(-|+)Ucache] [-u|+u[options]] [-V|+V[[-|+]types]] [-v|+v[options]] [(-|+)W] [(-|+)w] [(-|+)X] [(-|+)x] [-Y|+Y[options]] [-y|+y[options]] [-Z|+Z[options]] [(-|+)z] [--settings] [logfile...] but normally just analog [-G] [+gfilename] DESCRIPTION
Analog is a program for analyzing log files, and is designed to be fast and to produce attractive statistics. The usual (and easier) way of configuring analog is through a configuration file, not command line options. For more information about writing a configuration file or about the command line options see Readme.html in the analog documentation. A description of what options are available for the non-time reports is available in othreps.html#othclarg in the analog documentation. OPTIONS
--help Display version and help information and exit. (-|+)1 Toggle the Yearly Report. (-|+)4 Toggle the Quarter-Hour Report. (-|+)5 Toggle the Five-Minute Report. (-|+)6 Toggle the Quarter-Hour Summary. (-|+)7 Toggle the Five-Minute Summary. (-|+)A Turn all the reports (except the General Summary) off or on. (-|+)a Toggle output style between HTML and PLAIN formats, respectively. -B|+B[options] Turn the Browser Report off or on, possibly setting options. -b|+b[options] Turn the Browser Summary off or on, possibly setting options. (-|+)C'configuration-line' Include configuration-line in the configuration commands. -c|+c[options] Turn the Status Code Report off or on, possibly setting options. (-|+)D Toggle the Daily Report. (-|+)d Toggle the Daily Summary. -E|+E[options] Turn the Redirection Report off or on, possibly setting options. -F|+Fdate Toggle or set the FROM date. Use -F to turn the FROM date off, and use +Fdate to set the FROM date. -f|+f[options] Turn the Referrer Report off or on, possibly setting options. -G Do not use the default configuration file. +gfilename Add filename to the list of configuration files. (-|+)H Turn the Hourly Report off or on, possibly setting options. (-|+)h Toggle the Hourly Summary. -I|+I[options] Turn the Failure Report off or on, possibly setting options. -i|+i[options] Turn the Directory Report off or on, possibly setting options. -J|+J[options] Turn the User Failure Report off or on, possibly setting options. -j|+j[options] Turn the User Redirection Report off or on, possibly setting options. -K|+K[options] Turn the Failed Referrer Report off or on, possibly setting options. -k|+k[options] Turn the Redirected Referrer Report off or on, possibly setting options. -L|+L[options] Turn the Host Failure Report off or on, possibly setting options. -l|+l[options] Turn the Host Redirection Report off or on, possibly setting options. -M|+M[options] Turn the Virtual Host Failure Report off or on, possibly setting options. (-|+)m Toggle the Monthly Report. -N|+N[options] Turn the Search Query Report off or on, possibly setting options. -n|+n[options] Turn the Search Word Report off or on, possibly setting options. (-|+)Ooutput-file Write output to output-file. Use - for stdout. -o|+o[options] Turn the Domain Report off or on, possibly setting options. (-|+)P Toggle the Processing Time Report. (-|+)p Toggle the Operating System Report. (-|+)Q Toggle the Quarterly Report. -q|+q[[-|+]types] Turn all warnings off/on, or remove/add/use exactly specified types of warnings. -R|+R[options] Turn the Virtual Host Redirection Report off or on, possibly setting options. -r|+r[options] Turn the Request Report off or on, possibly setting options. -S|+S[options] Turn the Host Report off or on, possibly setting options. -s|+s[options] Turn the Referring Site Report off or on, possibly setting options. -T|+Tdate Toggle or set the TO date. Use -T to turn the TO date off, and use +Tdate to set the TO date. -t|+t[options] Turn the File Type Report off or on, possibly setting options. (-|+)Ucache Use file cache for cache output. -u|+u[options] Turn the User Report off or on, possibly setting options. -V|+V[[-|+]types] Turn all debugging off/on, or remove/add/use exactly specified types of debugging messages. -v|+v[options] Turn the Virtual Host Report off or on, possibly setting options. (-|+)W Toggle the Weekly Report. (-|+)w Toggle the Hour of the Week Report. (-|+)X Toggle GOTOS (on and off only). (-|+)x Toggle the General Summary. -Y|+Y[options] Turn the Internal Search Query Report off or on, possibly setting options. -y|+y[options] Turn the Internal Search Word Report off or on, possibly setting options. -Z|+Z[options] Turn the Organization Report off or on, possibly setting options. (-|+)z Toggle the File Size Report. --settings Instead of processing any files, display in English the settings analog would use if it ran normally. This is useful for trou- bleshooting. logfile... The logfiles to be analysed. Use - for stdin. SEE ALSO
The analog home page at http://www.analog.cx/ The analog documentation on your local machine, or from the analog home page. BUGS
An up to date list of known bugs and bug fixes can be found at http://www.analog.cx/bugs.html AUTHORS
Analog and related documentation was written by Stephen Turner <analog-author@lists.meer.net>, with contributions from other authors. (See acknow.html in the analog documentation.) This man page was written by Alexander Toth <alex@purificator.net>. Analog Version 6.0 19 December 2004 analog(1)
All times are GMT -4. The time now is 01:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy