User delete & search!

Taking care of your Linux box.
Post Reply
telenor
Havaldaar
Posts: 104
Joined: Tue Mar 29, 2005 11:08 am

User delete & search!

Post by telenor »

AOA,

I want a script for user delete & search from the file.



The file format is:

zia.ali zia.ali@mydomain.com
saleem.khans saleem.khan@mydomain.com
abdul.ghani abdul.ghani@mydomain.com
adnan.siddiqui adnan.siddiqui@mydomain.com
shahzor
Naik
Posts: 72
Joined: Thu Jun 29, 2006 11:33 am
Location: Quetta
Contact:

Post by shahzor »

but why you need an script for it what do you want to do please provide a bit of description.
LinuxBoy
ranatanveer
Subedar
Posts: 355
Joined: Sat May 07, 2005 11:54 am
Location: Lahore
Contact:

Post by ranatanveer »

I want a script for user delete & search from the file.
learn sed http://www.grymoire.com/Unix/Sed.html
Regards

Rana Tanveer
+923224194457
Linux Student

For Affordable Web Development http://www.affordableprogrammers.com
http://www.qualityprogrammers.com
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

sed won't help here. awk, perl, python, ruby, or even plain old /bin/sh will.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear ranatanveer,
Salam,
lambda wrote:sed won't help here. awk, perl, python, ruby, or even plain old /bin/sh will.
Indeed. I totally agree with lambda.

telenor, If you try to search at Porgamming Section of Linux Pakistan, I am sure you will find solution as lambda have given this task to Linux Pakistan Forum Members.

Best Regards.
Farrukh Ahmed
ranatanveer
Subedar
Posts: 355
Joined: Sat May 07, 2005 11:54 am
Location: Lahore
Contact:

Post by ranatanveer »

Wa Alaikum Salam, LinuxFreak

I don't want to argue with you and lambda, i always respect you from my hear, because i have learned a lot from both of you.

but here i want to share that, i only know bash awk and sed and a little perl, and i am capable to do anything i want to do.

so the request of telenor:
I want a script for user delete & search from the file.
this work can be done simply with 1 line sed (if meaning of telenor saying is same :D ), as sed has both search and replace/delete patterns. (moreover sed and awk has many more capabilities which are unknown to me :lol: )
Regards

Rana Tanveer
+923224194457
Linux Student

For Affordable Web Development http://www.affordableprogrammers.com
http://www.qualityprogrammers.com
Post Reply