09-02-2009
Command to parse a word character by character
Hi All,
Can anyone help me please,
I have a word like below.
6,76
I want to read this word and check if it has "," (comma) and if yes then i want to replace it with "." (dot). That means i want to be changed to 6.76
If the word doesnot contain "," then its should not be changed.
Eg.
6.74 ----> should be 6.74 only [ i mean no change required]
5,73 ----> should be 5.73 [change required has mentioned above]
777,9 ----> should be 777.9 [change required has mentioned above]
2000 -----> should be 2000 only [ i mean no change required]
Thanks in advance,
Giri
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can I grep for a certain letter that only shows on the 3rd letter or character.
ex:
ASGHDY
SHTYRD
SDTYRD
IGIKGD
I only want the TY part of the 3rd character
so output would only be SHTYRD and DDTYRD - I only want the TY on the 3rd character.
THANKS (5 Replies)
Discussion started by: jjoves
5 Replies
2. UNIX for Dummies Questions & Answers
Hi
I would like to accept in a string from user like
username/pwd@dbname
suppose the user does not input @ then i should throw an error that @ symbol missing . How to achieve this
Thanks in advance
Suresh (6 Replies)
Discussion started by: ssuresh1999
6 Replies
3. Shell Programming and Scripting
hello,
How to parse a file to see if a specific line is commented by '#' character?
filename: file1
cat file1
...
# /usr/bin/whatever
...
thank you (9 Replies)
Discussion started by: melanie_pfefer
9 Replies
4. UNIX for Dummies Questions & Answers
Hi,
For example, i have a string
"123 456 789 abc 111 222 333"
and I would like to delete all the characters before abc so that it becomes
"abc 111 222 333"
how can i do that in unix? using sed?
note: I actually don't know how many words/charachters before "abc", so the "cut"... (9 Replies)
Discussion started by: phandy
9 Replies
5. Shell Programming and Scripting
Friends, I'm looking for a command that delete the first tho caractere in a word. Here is an exp :
I want to replace "20091001" by "091001"
or "replace" by "place"
Thx, (13 Replies)
Discussion started by: newpromo
13 Replies
6. Shell Programming and Scripting
Hi all,
I have a file with some module names as below.
Font::AFM
Data::Grove ---> libxml-perl
Net::LDAP ---> perl-ldap
DBI
XML
....
...
....
and so on ...
The file has some lines with the character " -->" .
Now how can I cut only the last column of the line wherever "-->" is... (4 Replies)
Discussion started by: vijaya2006
4 Replies
7. Shell Programming and Scripting
Hi Expert,
I would like to know on how to export only the first 6 character of below
0050569868B7
ABCDEFGHTY
to
005056
ABCDEF
Thank you.
Reggy (7 Replies)
Discussion started by: regmaster
7 Replies
8. Shell Programming and Scripting
Hi friends,
I am working in a korn shell. i want to know the command which gives me the previous one character and next one character of a given keyword in a string?
for exmaple:
input string: /bin/dir/folder1/.proc_name^folderone
Keyword: proc_name
output : .^
... (10 Replies)
Discussion started by: neelmani
10 Replies
9. Shell Programming and Scripting
How can I represent the position of 1 (considering only the 1s after the colon) in the word from field5 and above; counting from right to left.
Input:
TT-124 06-03-14 08-02-10 FAS CAT1:10
TT-125-1 05-03-14 10-06-08 CAS CAT2:1010 FAT1:10000
TT-125-3 07-03-14 11-02-06 FAS FAT1:1101... (6 Replies)
Discussion started by: aydj
6 Replies
10. Shell Programming and Scripting
Hi,
I have a file which looks like this
id integer,
name string,
create_dt date,
I want to remove all words that are present before the character ,
My output should be
id,
name,
create_dt,
Thanks
wah (2 Replies)
Discussion started by: wahi80
2 Replies
LEARN ABOUT DEBIAN
sucrack
SUCRACK(1) General Commands Manual SUCRACK(1)
NAME
sucrack - is a multithreaded Linux/UNIX tool for brute-force cracking of local user accounts via su.
SYNOPSIS
sucrack [options] wordlist
DESCRIPTION
sucrack is a multithreaded Linux/UNIX tool brute-force cracking tool that drives su(1) with referencing a specific user and uses words from
a wordlist as passwords. Running sucrack does not require high privileges on the target system.
OPTIONS
sucrack allows reading passwords from stdin. In that case, use '-' instead of a filename as wordlist parameter.
Common options:
-h print help message
-a use ansi escape codes for nice looking statistics (requires --enable-statistics configuration flag)
-s <seconds>
statistics display intervall (requires --enable-statistics configuration flag)
-c only print statistics if a key other than `q' is pressed
-r enable rewriting of dictionary words (see rules below)
-w <num>
number of threads to run with.
-b <size>
size of the word list buffer
-u <user>
user account to su to
-l <rules>
specify certain rules for the rewriting process
Rewriting rules:
A Rewrite word with only upper case characters
F Rewrite word with first character as upper case
L Rewrite word with last character as upper case
a Rewrite word with only lower case characters
f Rewrite word with first character as lower case
l Rewrite word with last character as lower case
D Prepend each digit (0-9) to the word
d Append each digit (0-9) to the word
e enleet the word
x apply all rules to a word
ENVIRONMENT VARIABLES
SUCRACK_SU_PATH
The path to su (usually /bin/su or /usr/bin/su)
SUCRACK_AUTH_FAILURE
The message su returns on an authentication failure (like "su: Authentication failure" or "su: Sorry")
SUCRACK_AUTH_SUCCESS
The message that indicates an authentication success. This message must not be a password listed in the wordlist (default is
"SUCRACK_SUCCESS")
AUTHOR
Nico Leidecker <nfl@portcullis-security.com>
http://www.leidecker.info
SEE ALSO
su(1)
Version 1.2.3 SUCRACK(1)