want to search some content of the file with specific to user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting want to search some content of the file with specific to user
# 1  
Old 07-30-2012
MySQL want to search some content of the file with specific to user

I have some users in one unix system and i want to search some files with specific to user and then i want to find some content inside that file so can u help me how we can implement it?

File location is as below.
/pools/home_unix/cmadireddy/work/models/model/
cmadireddy is user name.
now under above path i want to open one file makefile and want to search one string from that file.
hope you ppl r geting wt i want to tell.

I could not find any post/thread for the same.
Smilie
Help me its urgent.
thanks prashant
# 2  
Old 07-30-2012
Hello Prashant,

I can understand that u need to search for something! What is that u exactly want?

A script that searches something? if so, what would be its inputs? what will be the file that u want to search?

Please explain in detail!! Smilie
# 3  
Old 07-30-2012
MySQL

Hello,

There are predefined path and predefined files under that path.
I want to search some string inside that file and if found then proper msg should be displayed.

and i want to do this process based on user and followed by string based files is same for all the user.

Second things i want to implement it based on switch case or let me know if any other option is fine or not?

hope you are geting wt i want to tell u.

thanks
prashant
# 4  
Old 07-30-2012
Hey,

Here are ur needs.. Correct me if wrong!

1> Get the username
2> Search a string inside some files
3> If found, display message

Now the problem is
1. Are there multiple files that you would need to search?
2. What is "that string"???

Yes. Switch case is good! no probs! Smilie
This User Gave Thanks to PikK45 For This Post:
# 5  
Old 07-30-2012
Hi..
thanks for the same.

There are only two files makefile and makefile.scpd and i need to search predefined string say rms, ams etc inside that files.

Thanks prashant

---------- Post updated at 08:39 AM ---------- Previous update was at 08:11 AM ----------

Smilie

the below code will take model no and search under that model no a specific word.


echo "Enter model no for searching string inside makefile"
read inputs2
#find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \;
#;;

I am getting below error.
./menu1.sh: line 151: syntax error near unexpected token `"Hit <ENTER> to continue:"'
./menu1.sh: line 151: `echo "Hit <ENTER> to continue:"'

Can someone help me?

thanks prashant..
# 6  
Old 07-30-2012
Why is
Code:
#find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \;
#;;

being commented?? Smilie
# 7  
Old 07-30-2012
because of error i have commented it.

prashant
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search the specific content from the complex file

Hi, I have a file with complex data without delimiter, have requirement to fetch the specific record based on some charcters. here is my file data ... (12 Replies)
Discussion started by: Riverstone
12 Replies

2. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

3. Shell Programming and Scripting

Search specific name in a file and fetch specific entries

Hi all, I have 2 files, One file contain data like this FHIT CS CHRM1 PDE3A PDE3B HSP90AA1 PTK2 HTR1A ESR1 PARP1 PLA2G1B These names are mentioned in the second file(Please see attached second file) as (7 Replies)
Discussion started by: manigrover
7 Replies

4. Shell Programming and Scripting

Urgent request to consider:Search specific name in a file and fetch specific entries

Hi all, I have 2 files, One file contain data like this FHIT CS CHRM1 PDE3A PDE3B HSP90AA1 PTK2 HTR1A ESR1 PARP1 PLA2G1B These names are mentioned in the second file(Please see attached second file) as # Drug_Target_X_Gene_Name:(Where X can be any number (1-1000) (1 Reply)
Discussion started by: manigrover
1 Replies

5. UNIX for Advanced & Expert Users

allow user to use sudo cp on a specific directory and only a specific file

Is there a way to allow a user to use sudo cp on a specific directory and only a specific file? (6 Replies)
Discussion started by: cokedude
6 Replies

6. Shell Programming and Scripting

Extract specific content from a file

My input file: >sequence_1 ASSSSSSSSSSSDDDDDDDDDDDCCCCCCC ASDSFDFFDFDFFWERERERERFSDFESFSFD >sequence_2 ASDFDFDFFDDFFDFDSFDSFDFSDFSDFDSFASDSADSADASD ASDFFDFDFASFASFASFAFSFFSDASFASFASFAFS >sequence_3 VEDFGSDGSDGSDGSDGSDGSDGSDG dDFSDFSDFSDFSDFSDFSDFSDFSDF SDGFDGSFDGSGSDGSDGSDGSDGSDG My... (22 Replies)
Discussion started by: patrick87
22 Replies

7. Shell Programming and Scripting

Remove specific content in a file

Hi, I have a file called fl_list consists of files i have to archive. I want to create a exception parm called except_parm, so if it finds the directory it will not archive these files and remove from fl_list. $ cat fl_list /apps/dev/ihub/ready/IA003B/IA003B_Deal_Header_yyyymmdd_hhmmss.txt... (1 Reply)
Discussion started by: k9cheung
1 Replies

8. AIX

find for specific content in file in the directory and list only file names

Hi, I am trying to find the content of file using grep and find command and list only the file names but i am getting entire file list of files in the directory find . -exec grep "test" {} \; -ls Can anyone of you correct this (2 Replies)
Discussion started by: madhu_Jagarapu
2 Replies

9. UNIX for Dummies Questions & Answers

grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi, I have a .txt file Sample: ===================== NEXT HOST ===================== AEADBAS001 ip access-list extended BLA_Incoming_Filter ip access-list extended BLA_Outgoing_Filter access-list 1 permit xxxxxxxxxxxxxx access-list 2 permit xxxxxxxxxxxxxx =====================... (4 Replies)
Discussion started by: I-1
4 Replies

10. UNIX for Dummies Questions & Answers

How to search files containing a specific word in the content

Hi all, Lets say I have 3 files a.txt and b.txt and c.txt. a.txt has the following text ==================== apple is good for health b.txt has the following text ==================== apple is pomme in french c.txt has the following text ==================== orange has citric acid... (1 Reply)
Discussion started by: amjath78
1 Replies
Login or Register to Ask a Question