Sponsored Content
Top Forums Shell Programming and Scripting My Values are Equal but They are Not Post 302400273 by fubaya on Tuesday 2nd of March 2010 08:38:29 PM
Old 03-02-2010
It works for me but does fail if I add a space before or after "errored" in the file. Extra text will show up in the output, but the spaces do not. Maybe that's it?
Code:
# echo "errored" > new_update_scripts.txt
# ./err.sh
errored = errored
true
#
# echo "errored " > new_update_scripts.txt
# ./err
errored = errored
false
#
# echo " errored" > new_update_scripts.txt
# ./err
errored = errored
false
#
# echo "x errored" > new_update_scripts.txt
# ./err
x errored = errored
false
#

edited to add:
Note that if you put the variable in quotes in the echo line, spaces do show up in the output.
Code:
change:
echo $errored = "errored"
to
echo "$errored" = "errored"

# echo " errored" > new_update_scripts.txt
# ./err
 errored = errored
false
#


Last edited by fubaya; 03-02-2010 at 09:43 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

equal to operator

Hi, I have the below script executed arg="dir" if "$arg" = "dir" then echo "true" else echo "false" fi Please let me know what happens in the if command. My output is: dir: dir: No such file or directory false which is not the desired output. When i used test command... (1 Reply)
Discussion started by: anijan
1 Replies

2. Shell Programming and Scripting

while [ $x -ge 50 ] + and equal to zero ; then

while + and equal to zero ; then what to punt instead of phrase and equal to zero. it's bash thank you in advance (1 Reply)
Discussion started by: losh
1 Replies

3. Shell Programming and Scripting

compare columns for equal values and output a summary

Hi all I am trying to scan a file that has 3 columns: red blue 123351 red blue 848655 red blue 126354 red blue 023158 black white 654896 red blue 650884 I want an output that sums the rows that have matching columns 1 and 2 :wall: red blue has 5 entries black white has 1 entry ... (4 Replies)
Discussion started by: reno
4 Replies

4. Shell Programming and Scripting

perl and not equal

Hi all I have this script that i have written in some logging for but i do not want it to log for all option, i have used Getopt::Long 2.11 to allow differnt switches but i only want logging on one type of switch this is my code but it does not like the ne (not equals) i do not wnat the... (7 Replies)
Discussion started by: ab52
7 Replies

5. Shell Programming and Scripting

If not equal to then loop

How do I go about amending this simple script that prompts for a yes/no response so that if neither Y or N are entered it will loop back back to the original prompt #!/bin/ksh echo "Enter yes of no" read answer if then echo "You selected yes" elif then echo "You selected no" elif... (5 Replies)
Discussion started by: gmears
5 Replies

6. UNIX for Dummies Questions & Answers

Same strings are not equal

Hi there can anyone help me please. I want to make a program to check if the executable file specified by the user exists in the directory. When I run this program particulary these lines of code does not work: if ("$fi" == "$name") then where It checks whether the specified file is equal to the... (1 Reply)
Discussion started by: FUTURE_EINSTEIN
1 Replies

7. UNIX for Dummies Questions & Answers

Replacing values in a column if they equal a certain value

Hi, I have a tab delimited text file where some lines have the string "NA" in the second column. For these lines, I want to replace NA with the value in the first column, the symbol underscore followed by the value in the fourth column. How do I go about doing that? Thanks! Input: 1 ... (3 Replies)
Discussion started by: evelibertine
3 Replies

8. Shell Programming and Scripting

Deleting consecutive equal values in a file

Hello everyone, I have a requirement as shown below. I need to delete consecutive same values from the source file and give it as output file. Source: a,b,c,d,e,e,f,g Target: a,b,c,d,f,g The repeating value "e" should be deleted from the file completely. How can I achieve this... (14 Replies)
Discussion started by: vamsikrishna928
14 Replies

9. Shell Programming and Scripting

Delete row if both percentage values are equal to zero

Hello, I have compiled a script but I have stucked at one point. Each line contains two pcs of % value and what I want to do is to delete any line if both % values are zero. data: expected output: ow3 should be deleted as both percentage value in related line are equal to zero. ... (2 Replies)
Discussion started by: baris35
2 Replies
opusinfo(1)							    opus-tools							       opusinfo(1)

NAME
opusinfo - gives information about Opus files and does extensive validity checking SYNOPSIS
opusinfo [ -q ] [ -v ] [ -h ] file1.opus ... fileN.opus DESCRIPTION
opusinfo reads one or more Opus files and prints information about stream contents (including chained and/or multiplexed streams) to stan- dard output. It will detect (but not correct) a wide range of common defects, with many additional checks specifically for Opus streams. For all stream types opusinfo will print the filename being processed, the stream serial numbers, and various common error conditions. For Opus streams, information including the version used for encoding, number of channels and other header information, the bitrate and playback length, the contents of the comment header, and general statistics about the stream are printed. Opusinfo is a fork of ogginfo(1) with the non-opus parts largely removed. OPTIONS
-h Show a help and usage message. -q Quiet mode. This may be specified multiple times. Doing so once will remove the detailed informative messages; twice will remove warnings as well. -v Verbose mode. At the current time, this does not do anything. NOTES
There are many kinds of errored, invalid, non-normative, or otherwise unwise stream constructions which opusinfo will not produce warnings on. Passing opusinfo with flying colors is not certification of the correctness of a stream. Future versions may detect more error condi- tions. AUTHORS
Michael Smith <msmith@xiph.org> Gregory Maxwell <greg@xiph.org> SEE ALSO
opusdec(1), opusenc(1) Xiph.Org Foundation 2012-05-28 opusinfo(1)
All times are GMT -4. The time now is 02:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy