10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
str contains tabs and multiple spaces
str="hello world. How are you?"
I want to check string start with hello world,
and my code is:
if ]world"* ]]; then
echo "found"
else
echo "not found"
fi
Not work
Other solution may work is to replace all tabs and... (4 Replies)
Discussion started by: cmdcmd
4 Replies
2. Shell Programming and Scripting
If a have a variable with a first and last name.
and say the variable looks like this...
FIRST LAST
how could process the variable to look like
First .L
bash 3.2 (osx) (3 Replies)
Discussion started by: briandanielz
3 Replies
3. Shell Programming and Scripting
I'm making a little game in Perl, and I am trying to remove the first instance of a character in an arbitrary string. For example, if the string is
"cupcakes"and the user enters another string that contains letters from "cupcake" e.g:
"sake"the original string will now look like this (below)... (3 Replies)
Discussion started by: whyte_rhyno
3 Replies
4. Shell Programming and Scripting
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies
5. Homework & Coursework Questions
Write a shell program to display the position of the right - most character in a given input string.
Example :
Input : RAHUL
Output : L is in the 5th position
also tell me how to count length of string and how to find the position of specific character in left most side.
Homework... (0 Replies)
Discussion started by: shashwat2691
0 Replies
6. Shell Programming and Scripting
i have a file that contains a pattern like this:
ajay 1234 newyork available
kumar 2345 denver
singh 2345 newyork
ajay 3456 denver
kumar 3456 newyork
singh 3456 delhi available
ajay 4567 miami
kumar 4567 miami
singh 4567 delhi
i want to search for each line... (5 Replies)
Discussion started by: ajay41aj
5 Replies
7. UNIX for Dummies Questions & Answers
I am doing some training for a job I have just got and there is an exercise I am stuck with. I am not posting to ask a question about logic, just a trivial help with string manipulation. I would appreciate if somebody could at least give me a hint on how to do it.
Basically, the intelligent part... (8 Replies)
Discussion started by: Dantastik
8 Replies
8. Shell Programming and Scripting
Hi,
i am just gettin exposed to UNIX.
Could anyone of u help me out with dis problem..?
i have a variable 'act' which has the value as follows,
echo $act gives -0- -0- -----0---- 2008-06-04 -0- -0-
echo "$act" | awk '{print ($act)}'
gives,
-0-
-0-
-----0----
2008-06-04
-0-
-0-
I... (2 Replies)
Discussion started by: jerrynimrod
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have a file with rows of text like so :
E100005568374098100000015667
D100005568374032000000112682
H100005228374060800000002430
I need to grab just the last digits(bolded) of each line without the proceeding text/numbers.
Thanks (5 Replies)
Discussion started by: james6
5 Replies
10. Shell Programming and Scripting
Hi, I have searched this long and hard and don't seem to see another post on this issue.
I have two strings each with the same characters but in a different order.
String1=”word”
String2=”dwor”
I want to test them to show their similarity. Unfortunately I can't do a sort so that they will... (9 Replies)
Discussion started by: Cactus Jack
9 Replies