10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using the below to random generate a password but I need to have 2 numeric characters and 6 alphabetic chars
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo ''
6USUvqRB
------ Post updated at 04:43 PM ------
Any Help folks - Can the output be passed onto a sed command to... (9 Replies)
Discussion started by: infernalhell
9 Replies
2. Shell Programming and Scripting
Hello,
I have a log file with logs such as
01/05/2017 10:23:41 : file.log.38: database error, MODE=SINGLE, LEVEL=critical, STATE: 01170255 (mode main
how can i use perl to extract the 8-digit number below from the string
01170255
Thanks (7 Replies)
Discussion started by: james2009
7 Replies
3. Shell Programming and Scripting
Hi All,
I am trying to find non-printable characters in a string. The sting could have alphanumeric, puntuations and characters like (*&%$#.') but not non-printable (or that is what I think they are called) which are introduced when you copy any text from DOS to unix box.
Input string1:... (10 Replies)
Discussion started by: dips_ag
10 Replies
4. Shell Programming and Scripting
I would like to search between two a string. I thought this would be easy. The is always at the beginning of a line.
The code:
gawk '/^/{d=$1},/searchstring/,/^(d+1)/'
or
gawk '/^/,/searchstring/,/^/'
did not return the desired result.
inputfile.txt
999 some text searchstring some... (6 Replies)
Discussion started by: sdf
6 Replies
5. UNIX for Dummies Questions & Answers
Hello,
i have a file called test
hello1
"how" are you4
good"bye"
good7bye
i am trying to print all lines from test that either end with a digit or contain a double quote character anywhere on the line.
i did
grep -n '$' test and was able to print lines ending with digits.
i also did... (2 Replies)
Discussion started by: hobiwhenuknowme
2 Replies
6. Shell Programming and Scripting
Hi all,
i have such string stored in a variable
var1 = 00000120
i want the o/p
var1 = 120
is it possible to have such o/p in ksh/bash ...
thanx in advance for the help
sonu (3 Replies)
Discussion started by: sonu_pal
3 Replies
7. Shell Programming and Scripting
print out 201 in following string, Please note the chars before 201 are random, no fixed format.
ua07app201 (20 Replies)
Discussion started by: honglus
20 Replies
8. UNIX for Dummies Questions & Answers
How could I check if a numeric variable has 5 digits in KSH...I have a zipcode variable that I know will always be 5 digits, and I want to print out an error if it is less or more than 5 digits the problem is that I have it as:
if ]
but this won't work because the statement doesn't see 0001 as... (3 Replies)
Discussion started by: developncode
3 Replies
9. Shell Programming and Scripting
I have a string like xxxxxx44. What's the best way to extract the digits (one or more) in a ksh script?
Thanks (6 Replies)
Discussion started by: offirc
6 Replies
10. UNIX for Dummies Questions & Answers
Hi guys,
I am not very experienced in writing ksh scripts and I am trying to write a piece of code that indicates if a given string contains only digits and no alphabet (upper or lower case). If i write it my way it would turn out to have a lot of comparisons.. :eek:
Thanks a lot in... (3 Replies)
Discussion started by: lakshmikanth
3 Replies