Need to implement one check in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to implement one check in shell script
# 1  
Old 06-18-2012
Need to implement one check in shell script

Hi,

I am facing one issue.I am working on one script where I want to implement one check
Code:
PSS/TFM/Coupon/trunk/CouponProject/CouponService/src/test/java/com/travelport/service/pss/coupon/validator/CouponValidationReqValidatorTest.java

Now my problem is or requirement is if the above line consist of PSS and trunk then mail should be sent[Mail part is completed].How could I impemment this check[consist of PSS and trunk]

What does the mean of below code?
Code:
Cpath=
PSS/TFM/Coupon/trunk/CouponProject/CouponService/src/test/java/com/travelport/service/pss/coupon/validator/CouponValidationReqValidatorTest.javaif [[ ${Cpath} =~ PSS.*trunk ]]; then


Last edited by Scrutinizer; 06-18-2012 at 08:37 AM.. Reason: formatting
# 2  
Old 06-18-2012
it's (binary operator, =~) used for pattern matching,if it matches then shell (bash or ksh) returns 0 and ıif-then statement procedures (commands) executed...
Code:
if [[ ${Cpath} =~ PSS.*trunk ]]; then
echo "Matches"
else
echo "No Match"
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

2. Shell Programming and Scripting

How to implement the logical express --- A(B+C) within single "if" statment in shell script?

On Linux OS, bash environment, I want implement the following code: if && ( || ) A,B,C represents some compare conditions. How to realize it ? Thanks! (1 Reply)
Discussion started by: qcmao
1 Replies

3. Programming

Shell programing to implement SQL package

hi all, i have a table with employee details like his name,addr,DOB etc. i need a shell program which takes one date as input from user and print the employees whose DOB is less than that date. in sql package the select query is written (2 Replies)
Discussion started by: vidyaj
2 Replies

4. Shell Programming and Scripting

Select query implement in a shell

I have been asked to create a shell script that accepts a number of SQL select queries as input, runs them in sequence, spools the output to an EXCEL workbook, where, each worksheet is an output of a Select statement run above. The workbook should be in a .XLS format. If a particular select... (2 Replies)
Discussion started by: ShellNovice1
2 Replies

5. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

6. Shell Programming and Scripting

Shell quiz: implement a mutex

How would you make sure that a shell script (or a portion thereof) does not run (it waits or it terminates with error) when another instance of it is already running? (11 Replies)
Discussion started by: colemar
11 Replies

7. Shell Programming and Scripting

check my first shell script

I have written the below script to determine whether a string is palindrome or not ? But its not working, any help to debug it ? I am new to this forum but when I searched for my question, I found that many people refused to answer this question thinking that its Homework question, Therefore I... (2 Replies)
Discussion started by: gridview
2 Replies

8. Shell Programming and Scripting

check in unix shell script so that no one is able to run the script manually

I want to create an automated script which is called by another maually executed script. The condition is that the no one should be able to manually execute the automated script. The automated script can be on the same machine or it can be on a remote machine. Can any one suggest a check in the... (1 Reply)
Discussion started by: adi_bang76
1 Replies

9. Shell Programming and Scripting

batch file not running after implement dummy shell

Hi, I want to ask if anyone has any ideas, why the batch file i created to transfer files on my desktop doesn't run after i put this line in /etc/passwd and any idea to overcome it ? Thanks user:!:xxx:xxx::/home/user:/usr/local/bin/ssh-dummy-shell (2 Replies)
Discussion started by: DarReNz
2 Replies
Login or Register to Ask a Question