Sponsored Content
Full Discussion: Matching character
Top Forums UNIX for Dummies Questions & Answers Matching character Post 302157001 by Smiling Dragon on Wednesday 9th of January 2008 06:08:34 PM
Old 01-09-2008
Quote:
Originally Posted by felixwhoals
Alright, I am stuck here.

I have this variable that stores the word = HELLO and I have converted it it to -----
I have asked user to input one character at a time. SAy, if they enter E.
Therefore, I need to search 2nd character and input E there.
makes it -E--- (other checkings have been done)
I need to use while loop and if statement to do it. Wonder if anyone could help. Now I found matching character but I don't know how to output them into ----- variable.
So what will it do when they enter 'L' first? Does it produce:
--L--
or
---L-
or
--LL-
?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

character matching

Is there a way to pull out a character at a time from a work in unix, using a shell script? (1 Reply)
Discussion started by: Rukshan
1 Replies

2. Shell Programming and Scripting

Matching a choice of character in test command

Hi ] && exit 0 Although it, the $answer, is 'y', the test operation returns true. && exit 0 This works but I want to do multiple choice matching. I don't want to do like: Please help (2 Replies)
Discussion started by: lalelle
2 Replies

3. Shell Programming and Scripting

matching repeated character

looking for a bit of help with sed. I have a file that looks a bit like this: sdfghhjk asdfdfghgj asdfhgghj werdfvtfh edftbgh 1211211221 sdffgfm dfghnhjm dfvfsgbgh adsfv bdhgn 1111111dffg dfv1122 dsgvbghn111111 fffffffgbdghn fffffff sfgh3333gs vdf (5 Replies)
Discussion started by: robsonde
5 Replies

4. Shell Programming and Scripting

tcl: regexp matching special character

Hello Experts, Can someone help me here: I have a variable which contains a string with "". set var1 {a} set str1 {a is the element i want to match} Now "regexp $var1 $str1" does not work? ("regexp {a\} $str1" works, but var1 gets it's value automatically from another script) Is... (6 Replies)
Discussion started by: sumitgarg
6 Replies

5. Shell Programming and Scripting

Matching multiples of a single character using sed and awk

Hi, I have a file 'imei_01.txt' having the following contents: $ cat imei_01.txt a123456 bbr22135 yet223 where I want to check whether the expression 'first single alphabet followed by 6 digits' is present in the file (here it is the first record 'a123456') I am using the following... (5 Replies)
Discussion started by: royalibrahim
5 Replies

6. Shell Programming and Scripting

pattern matching on any special character in Unix

Hi, I have field in a file which would come with any special character, how do i check that field? Eg: @123TYtaasa>>>/ 131dfetr_~2 In the above example, how do I add pattern for any special character on the keyboard. Thanks (3 Replies)
Discussion started by: techmoris
3 Replies

7. Shell Programming and Scripting

sed or awk delete character in the lines before and after the matching line

Sample file: This is line one, this is another line, this is the PRIMARY INDEX line l ; This is another line The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies

8. Shell Programming and Scripting

Check Character matching from pos 7-15 to pos 211-219 if True then replace 211-219 with spaces

Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space. Total length of record is 420. Here is the specification of the data in file. Position Field Data Type... (5 Replies)
Discussion started by: lancesunny
5 Replies

9. Shell Programming and Scripting

Merging two special character separated files based on pattern matching

Hi. I have 2 files of below format. File1 AA~1~STEVE~3.1~4.1~5.1 AA~2~DANIEL~3.2~4.2~5.2 BB~3~STEVE~3.3~4.3~5.3 BB~4~TIM~3.4~4.4~5.4 File 2 AA~STEVE~AA STEVE WORKS at AUTO COMPANY AA~DANIEL~AA DANIEL IS A ELECTRICIAN BB~STEVE~BB STEVE IS A COOK I want to match 1st and 3rd... (2 Replies)
Discussion started by: crypto87
2 Replies

10. Ubuntu

Bash to ash port, character-matching problem

I'm trying to convert this working bash script into an Ash script, read -p "Username:" _username if ! ]]; then echo "Valid" else echo "INVALID" fi However, Ash does not recognize the "=~" character. How can I do this? Also, is there a good reference guide, so I... (5 Replies)
Discussion started by: fzivkovi
5 Replies
DICTL(1)						      General Commands Manual							  DICTL(1)

NAME
dictl - wrapper script for dict that permits using utf-8 encoded dictionaries on a terminal that is not utf-8 aware. SYNOPSIS
dictl [OPTIONS] [word] Description dictl calls dict with the arguments given on the command line. dictl takes the value of the environment variable DICTL_CHARSET as the user's preferred character set. If this variable is empty, dictl attempts to determine the character set to be used from the output of the locale command. Arguments passed to dictl including word are converted from the user's preferred character set to server's character set specified by DICTL_SERVER_CHARSET variable (utf-8 if it is unset), and passed to dict. The server's output from dict is converted to the user's pre- ferred character set. NOTE: Because iconv omits characters from output that are invalid, recode -f is used for character set conversions by default. If you prefer iconv, set DICTL_USE_ICONV variable to non-empty string. If you want to use konwert, set DICTL_USE_KONWERT to non-empty string. Because recode, iconv and konwert do not support conversion to or from the "C" or "POSIX" locales, it is recommended that all users whose locale is "C" or "POSIX", set DICTL_CHARSET to "latin1" (ISO_8859-1). OPTIONS
dictl accepts all dict options as described in dict(1). AUTHOR
dictl was written by Aleksey Cheusov <vle@gmx.net> This manual page was written by Robert D. Hilliard <hilliard@debian.org> and Aleksey Cheusov <vle@gmx.net> SEE ALSO
dict(1), recode(1), iconv(1), konwert(1) DICTL(1)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy