LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 09-12-2012, 03:35 PM   #1
brian00
Member
 
Registered: Aug 2011
Posts: 33

Rep: Reputation: Disabled
using string


below is my code

Code:
!#/bin/ksh
log=/usr/oracle/rman

if [[ -n `ls $$log/myfile.tst | grep 'MYDB'` ]] ; then
startup

the -n to see if string "MYDB" within the myfile.tst doesn't seem to work, please help.
 
Old 09-12-2012, 03:52 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
'grep -q -m1 MYDB $$log/myfile.tst' and use the $?
 
Old 09-13-2012, 04:41 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
You have at least 4 other threads going that cover the same subject in slightly
different wording ... can you please NOT do this in the future? Closed.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use Vi to match a string of text, add a new line, insert string... Slycraft Linux - Newbie 7 07-20-2012 11:24 AM
[SOLVED] Sed/awk/cut to pull a repeating string out of a longer string StupidNewbie Programming 3 03-21-2012 02:47 PM
[SOLVED] copy string a to string b and change string b with toupper() and count the chars beep3r Programming 3 10-22-2010 08:22 PM
read string after specific string from a text file using C++ programing language badwl24 Programming 5 10-08-2009 06:41 AM
Shell Script: Delete lines til string found or until particular string. bhargav_crd Linux - General 3 12-21-2007 12:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration