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
KWALLETCLI_GETPIN(1)					    BSD General Commands Manual 				      KWALLETCLI_GETPIN(1)

NAME
kwalletcli_getpin -- command line interface to pinentry SYNOPSIS
kwalletcli_getpin [-q] [-b | -m | -p prompt] [-E | -e errortext] [-N NoText] [-t desctext] [-Y YesText] DESCRIPTION
The kwalletcli_getpin utility is a shell wrapper speaking to pinentry using the Assuan protocol. It will ask the user for a passphrase and print it, without any trailing newline, to standard output. There are options for asking a boolean question or displaying a message. If PINENTRY is not empty but points to a non-existing or failing programme, pinentry is not called. Instead, xmessage(1) is used for boolean queries and messages if DISPLAY is set; otherwise, kwalletcli_getpin uses simple terminal I/O on GPG_TTY using stty(1) to disable echo of terminal input for passphrase queries. The options are as follows: -b Ask for a confirmation (boolean) instead of a passphrase. -E Unset a previously set error text. -E errtxt Set the error text to errtxt, displaying a dialogue box with a red X icon indicating that this is a retry question. -m Display a message (one-button query) instead of asking. -N NoText Use NoText instead of Cancel for the text of the abort button, if any. -p prompt Set the small descriptive text shown in front of the input field (``the Prompt'') to prompt. -q Be more quiet. -t desctxt Set the descriptive text (the input challenge) to desctxt. -Y YesText Use YesText instead of OK for the text of the confirm button. All input and output is assumed to be in UTF-8. RETURN VALUES
The kwalletcli_getpin utility exits 0 on success, 1 if the passphrase input was cancelled by the user, or >1 if an error occurred. Confirma- tion (boolean) error codes are 0 for Yes, 1 for No, or >1 if an error occurred. Messages return >0 if an error occurred, 0 otherwise. A summary of the error codes follows: 0 Read password successfully. Boolean question returned Yes/OK. 1 Boolean question returned No/Cancel. 2 Wrong command line syntax. 3 The process reading user input unexpectedly terminated or errored out. 4 Unexpected result reading from pinentry. 5 Unable to determine controlling tty, caller must set GPG_TTY. 6 Caught SIGHUP, SIGINT, SIGQUIT, SIGTRAP, SIGPIPE, or SIGTERM. ENVIRONMENT
DISPLAY If not set, pass current terminal information to pinentry. GPG_TERM Terminal type of the current tty. Defaults to the value of the environment variable TERM, or ``vt100'' if unset. GPG_TTY The current terminal, determined by tty(1) if unset. LC_CTYPE Passed to pinentry. Default: ``en_US.UTF-8'' LC_MESSAGES Passed to pinentry. Unset by default. PINENTRY The pinentry programme to use. Default: ``pinentry'' SEE ALSO
gpg-agent(1), kwalletcli(1), pinentry(1), stty(1), tset(1), tty(1) AUTHORS
kwalletcli_getpin was written by Thorsten Glaser <tg@mirbsd.org> mostly for tarent GmbH. CAVEATS
Some newer pinentry features, such as three-button operation or setting the window title, are not supported yet. BUGS
Some pinentry programmes may not support messages correctly and display them as boolean queries instead. Some implementations display labels with the wrong charset. Neither of these two problems is an issue in kwalletcli_getpin but a bug of the backend implementation. BSD
May 10, 2011 BSD
All times are GMT -4. The time now is 10:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy