10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, coding a simple program to compare an entered number to a randomly generated one. The number of digits are restricted so I'm just trying to figure out how to refer to the index value in a string and then compare it to the variable I want. I don't know if bash automatically indexes strings, so... (7 Replies)
Discussion started by: outofcookies
7 Replies
2. Shell Programming and Scripting
Objective is to substitute Jan with 01, Feb with 02 and so on. The month will be provided as input.
I could construct below awk and it worked.
echo Jun | \
awk 'BEGIN{split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",mon," ")}{ for (i=1;i<=12;i++){ if ($1==mon) printf("%02d\n",i)} }'
... (4 Replies)
Discussion started by: krishmaths
4 Replies
3. Shell Programming and Scripting
here below is sample string
null pointer dereference of 'resourceList' where null is returned from a method/opt/bld/fetch/ds/interzone/notification/LocalLineStatusNotificationListener.java:79
null pointer dereference of 'reList' where null is returned from a... (3 Replies)
Discussion started by: vivek d r
3 Replies
4. Shell Programming and Scripting
I met a challenge to filter ~70 millions of sequence rows and I want using awk with conditions:
1) longest string of each pattern in column 2, ignore any sub-string, as the index;
2) all the unique patterns after 1);
3) print the whole row;
input:
1 ABCDEFGHI longest_sequence1
2 ABCDEFGH... (12 Replies)
Discussion started by: yifangt
12 Replies
5. Shell Programming and Scripting
i would like to search for a letter in a string and get its index position.
example:
name='john'
pos=$(expr index $name o)
the result will be equal to 2 (2nd position)
how do you make this thing not case sensitive?
example:
name='john'
pos=$(expr index $name O)
the... (1 Reply)
Discussion started by: kokoro
1 Replies
6. Shell Programming and Scripting
Hi All,
I have a file (Names.txt) and the contents of the file is give below.
$ cat Names.txt
FF313207008.txt
FF223207007.txt
FF143207006.txt
FF372150600.txt
FF063407005.txt
FF063307005.txt
$
From these given file names I want to find the files which has the 6th index value as 2. So... (5 Replies)
Discussion started by: krish_indus
5 Replies
7. UNIX for Dummies Questions & Answers
I have a line "My name is Deepak"
How can i search a string Deepak in the line and find out its index position.
Here in this case the result should be 12. (3 Replies)
Discussion started by: dr46014
3 Replies
8. Shell Programming and Scripting
I need to find the index of last '|' (highlighted in bold) in awk :
|ifOraDatabase.Lastservererr<>0then|iferr_flag<>0then|end if
Please suggest a way... Thanks (5 Replies)
Discussion started by: joyan321
5 Replies
9. Shell Programming and Scripting
I come across the problems when assigning the array in the script below . How to use the array with the 'string index' correctly ? When I assign a new string index , the array elements that are previously assigned are all changed .:eek::eek::eek:
$ array=211
$ echo ${array}
211
$... (4 Replies)
Discussion started by: youareapkman
4 Replies
10. Shell Programming and Scripting
I have looked for hours for an answer, so I have decided to request your guidance.
I want to substract the first number (series of digits) contained in a string. This string is the output of another command. The substring (number) can be located at any position inside the string.
I want to... (4 Replies)
Discussion started by: jcd
4 Replies