10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I apologize if it was asked before but I couldn't find something related.
I want to replace 2 strings in a file
e.g
pwddb=Lar1wod (need to replace string after =)
pwdapp=Wde2xe (need to replace string after =)
AND in same file want to find last occurrence of a string (SR2-134561),... (2 Replies)
Discussion started by: J_ang
2 Replies
2. Shell Programming and Scripting
Hi Gurus,
I need find which file contains certain string in one directory.
when using
cat * |grep "string", I can get the string name but no file name displayed.
I am wondering if there is any option I can use to get which file contains this certain string.
Thanks in advance. (3 Replies)
Discussion started by: ken6503
3 Replies
3. Shell Programming and Scripting
I am trying to execute something like this
file=/tmp/test.txt
firstline=$(head -n 1 $file)
value=`echo $firstline | cut -d'=' -f2`
if
then
echo true
fi
i read the first line of a file, cut to the numeric value in the first line and check if it greater than 2
but for some... (11 Replies)
Discussion started by: madhan_dc
11 Replies
4. UNIX for Dummies Questions & Answers
Hi
I have a file which has sequences which look like this
>String1
aqwertrtrytytyuuijhgddfghhhghhgjhjhhsswekrkmygppdslxmvbnhkwqalldrtjbllnlnlnnnvc
>String2
qwwerrtyuiopasdfghjmnbvfklzxerbvcwghjjkoowwqerrtggbddqsdfgaqwcxzakjtyugfsdefrtgyhujiknbbbbcdcdcxsxsx zxzxcvcfcdcg
>String3... (5 Replies)
Discussion started by: sa@@
5 Replies
5. UNIX for Dummies Questions & Answers
Input:
XXX:1,XXX:3,XXX:3
Output:
A=1
B=3
C=3
Below code is what i do currently. However it doesn't work out for all cases. As some times the last digit extracted is giving me error. It cant be used for arithmetic computation.
Any better methods out there? If possible, can you... (9 Replies)
Discussion started by: bananamen
9 Replies
6. Shell Programming and Scripting
Hi I am beginner in writing shell scripting please tell me how to compare a string in Unix shell.
i have two variables in a shell script,
var1="00101 00201 00301 303 401 405"
var2="101 201 301"
i want to compare var1 with var2 . for example if 101 from Var1 present in Var2 or not. similarly... (5 Replies)
Discussion started by: nikesh29
5 Replies
7. UNIX for Dummies Questions & Answers
Hi,
If my input string is 3a3b4c then my result should be aaabbbcccc. Please guide me how to achieve this in a bash script.
Thanks (18 Replies)
Discussion started by: pandeesh
18 Replies
8. UNIX for Dummies Questions & Answers
I want to extract the string TC from the string TC10, the string can have any characters
out of .
I used the following code but didnt get the right output. Please guide
nuc=match(val,/*/)
seq=substr(val,RSTART,RLENGTH)
---------- Post updated at 09:40 PM ---------- Previous update was... (0 Replies)
Discussion started by: newbie83
0 Replies
9. Shell Programming and Scripting
how can i print all the chars of a string one by line?
i have thought that use a for cicle and use this command inside:
${VARIABLE:0:last}but how can i make last? because string is random
P.S. VARIABLE is the string
or can i make a variable for every chars of this string?
this was my idea... (10 Replies)
Discussion started by: tafazzi87
10 Replies
10. Shell Programming and Scripting
Could anyone of you please give me some idea to decode base 64 encoded value in ksh? (4 Replies)
Discussion started by: nram_krishna@ya
4 Replies