finding string at runtime


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting finding string at runtime
# 1  
Old 05-01-2008
finding string at runtime

Hi

I am creating a script in shell (sh), in which i will enter a string at runtime. let i will enter the string asdfergtdev_DEV2(or DEV,DEV3,DEV1 etc). i want it will find DEV2(it will be only find DEV2 at last 4 digit 3 in case only DEV,no metter if before it, there is dev) and append _qqq01 at end like sdfergtdev_DEV2_qqq01. if there is not DEV at the end it will append _aa01
for exp :- sdfergtdev123a_RC01.

Please help !
Thanks,
Inder
# 2  
Old 05-01-2008
Decoding your requirement isn't straightforward. Do you have code which almost works? Could you post it and tell us what's wrong with it?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding a string in a file

Hello All, I have a text file, i want to search for a string in it and the string is repeated multiple times in a file i want to get the first occurence of the string in a variable. the content of file is like: I want to grepthe first occurance of "Configuration flow done" and store the... (7 Replies)
Discussion started by: anand2308
7 Replies

2. Programming

Need help for replacing a string in a text file at runtime !

Hi All, I am facing an issue... I need to replace some string in a text file while the same file is read by some other user at the same time. The other user is using it in the Read only mode. So I can't create a temporary file and write the content first and then write it back into the original... (2 Replies)
Discussion started by: agupta2
2 Replies

3. Shell Programming and Scripting

shell script for finding average runtime of other script

so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to... (3 Replies)
Discussion started by: navlelo
3 Replies

4. Shell Programming and Scripting

finding the Last String in a Line

Hi, i am looking for a command that can help me find the last Sting in a Line ex.. yyeyrtehhehrerry: change this from to here i want to extract END. (5 Replies)
Discussion started by: Rohit1234
5 Replies

5. Shell Programming and Scripting

Finding a string with another string is found

finding a string with another string is found EX: abs c/- i want to find /-, then copy abs. i know it's easy use awk, but my problem is the substr syntax. substr($2,2,2) will give me /- but the conflict is /- is not always the second characted of the second string. (11 Replies)
Discussion started by: engr.jay
11 Replies

6. Shell Programming and Scripting

Finding a letter in a string

How to check whether a particular string contains dot or not? Here I can not use grep as the string is not in a file. I will get this string from user input Thanks, (2 Replies)
Discussion started by: balamv
2 Replies

7. Shell Programming and Scripting

finding lines only between a certain string

Dear experts, Ive been trying to figure this out for a while, but i cant. Please help. I have a file, with approx 1 million lines. The contents are separated with "----------". Please see example below So my problem is, i need to find all texts that have the keyword "GAA", but i need... (14 Replies)
Discussion started by: aismann
14 Replies

8. Shell Programming and Scripting

help with finding a string

Hello folks I have a text file abcd.txt and has a line starting with number '8'. I have a string in this line starting at position 'a' to position 'b' also this string is a number and have to be reduced by 1. there is also a problem that it has to be padded with zeros to make the string... (2 Replies)
Discussion started by: sandyg
2 Replies

9. Programming

finding folders in runtime

hi everyone i have two folders. one is ramesh(folder) and other is ramesh1(sub folder of ramesh) i have to find the second(ramesh1)folder name in runtime. please tell me the way to find this. thank you ramesh (1 Reply)
Discussion started by: ramesh.jella
1 Replies

10. Shell Programming and Scripting

Finding part of a string

Hi I am very new to KSH programming and need some help with finding a string in an error log currently i am doing cat FTP_LOG.lis | grep Warning which gives me Warning: Authentication failed. Remaining authentication methods: 'publickey,pas I want to only pick up the test between the... (4 Replies)
Discussion started by: DAFNIX
4 Replies
Login or Register to Ask a Question