Linux Script
Hai all,
1) I want to find out 'ora" from a <test> file wich contains data as follows:- oracle oraman orgrp oragrp oracmon When cat filename | grep ora command is issued, it shows the complete world which contains ora.. is there anyother way, we can fetch only "ora" from that.. 2) am writing a script such that the user should enter username and password, but , if the username is not entered and user tries to move on to password , when <ENTER> is pressed without entering username , user should get the message saying that "USERNAME SHOULD BE ENTERED".. IIn Foxpro, this can be acheived by using EMPTY CHECK ....Tried the following : stored input in a variable called “uname” and stored uname in a temp file called “test1” Given a command # a=`wc –c /test1` If it is a=0 message will displays, >0 then comes to next field: But it is not working.. Any help on the above is highly appreciated.. Thanks Yusuf |
Here is a way to find and print the string "ora".
Code:
sed 's/.*ora.*/' filename | grep ora Code:
Valid=no |
Quote:
Thanks Carl, script works fine. but not the sed command.. [oradev@oracle datas]$ cat new.txt oracle proalc porat lorat gorak forak oradev@oracle datas]$ sed 's/.*ora.*/' new.txt | grep ora sed: -e expression #1, char 10: unterminated `s' command Your help is highly appreciated. Thanks Yusuf |
Oops. I'm missing one part. It should be:
Code:
sed 's/.*ora.*/ora/' filename | grep ora |
Quote:
Thanks carltm , that really helped. Yusuf |
All times are GMT -5. The time now is 07:25 PM. |