LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2004, 05:23 PM   #1
kemplej
Member
 
Registered: Dec 2003
Posts: 235

Rep: Reputation: 30
Simple Bash Script Help Command


Ok I need help creating a simple script to remove users from a NCSA squid userfile. How would one look where you can type squiddeluser username and it will remove it from a passwd file?


I saw some people have suggested sed but sed keeps removing ALL the users?
 
Old 03-11-2004, 04:52 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,420

Rep: Reputation: 198Reputation: 198
only because you are doing sed wrong!
a sed script file:
==============
#!/usr/bin/sed -f

/USER1/ {
d
}

============
will delete all *lines* with USER1 in them.

but
/USER1/ {
///
}

will delete JUST each string USER1

okey doke?

regards billy
 
  


Reply


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
Simple bash script lp449 Linux - Networking 3 08-02-2005 05:25 PM
Simple bash script Soulful93 Programming 1 06-04-2005 08:26 PM
Simple Bash Script dmedici Programming 9 12-31-2004 04:48 AM
Help with simple bash script - please tw001_tw Linux - Software 5 12-19-2004 10:02 PM
Simple BASH script fio Linux - General 5 01-18-2003 04:26 PM


All times are GMT -5. The time now is 08:15 PM.

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