LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Simple Bash Script Help Command (https://www.linuxquestions.org/questions/linux-software-2/simple-bash-script-help-command-155988/)

kemplej 03-10-2004 04:23 PM

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?

bigearsbilly 03-11-2004 03:52 AM

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


All times are GMT -5. The time now is 03:24 AM.