Sponsored Content
Special Forums UNIX Desktop Questions & Answers Question about a VIM script from a absolute noob Post 302736753 by DanableLector on Wednesday 28th of November 2012 12:11:25 AM
Old 11-28-2012
@Joseph TKLee: Thank you for such a quick response. I created this script.. err rather copied it.. in my bin directory, which is completely empty, save for this script. I am going out on a limb here but I am guessing my directory should have a list of users somewhere inside in order for it to work properly? (apologies.. I am about as new to this as it gets.)

---------- Post updated at 11:11 PM ---------- Previous update was at 11:03 PM ----------

Quote:
Originally Posted by Joseph_TKLee
run the follows on your environment. ( not sure which one is correct $user or $USER in your environment)
Code:
# echo $user
# echo $USER
# w | grep $user | cut -c19-30

You will get an idea what it is meant to do.

Cheers,

Last edited by DanableLector; 11-28-2012 at 01:12 AM.. Reason: n/a
 

10 More Discussions You Might Find Interesting

1. Programming

Question about compiling (noob)

I'm just getting started to lean C and I'm using Ubuntu today I found a tutorial at this site: http://einstein.drexel.edu/courses/CompPhys/General/C_basics/c_tutorial.html and I got an error after compiling the fist code: #include < stdio.h> void main() { printf("\nHello World\n"); } ... (9 Replies)
Discussion started by: arya6000
9 Replies

2. UNIX for Dummies Questions & Answers

Noob sorting question

Ok here is the deal, I have a command given to me by some systems guy who I cannot get ahold of on the weekend without paying him alot of money to help me. I need to get this done before Monday as I am just getting pummeled by DOS attacks. The comand given was.... netstat -ntu | awk '{print... (1 Reply)
Discussion started by: Hexabah
1 Replies

3. UNIX for Dummies Questions & Answers

Noob question on comparing #'s.

I have a file with 3 digit numbers in it formatted as such: 123 065 321 How would I go about seeing if each number is less than 100 and if so outputting it to another file Yes, I am a bit of a noob. I have tried with grep but I don't think it'll work. Any general direction would be... (6 Replies)
Discussion started by: kirkm76
6 Replies

4. Shell Programming and Scripting

noob question about redirecting stderr

I dont know what I am doing wrong but I would like to redirect the stderr output to a file? the specific command is this time wget http://www.something.com/somefile.bin All I want to see is time's output which is stderr so I can see how long the file download took. I've tried redirecting... (2 Replies)
Discussion started by: trey85stang
2 Replies

5. BSD

Complete noob question: Software installation

I'm a Linux guy who is tring out BSD for the first time... What is the BSD program to automatically fetch and and install software? Is it pkg_add? Will pkg_add automatically fetch and and install software? Does it work on all BSD variants? This is all I could find, but I wanted to make... (5 Replies)
Discussion started by: biznatch
5 Replies

6. Ubuntu

Simple Noob Question

I am editing the squid.confi on my server. I am done editing. How do I exit the confi file? Thank you. (2 Replies)
Discussion started by: sethartha
2 Replies

7. UNIX for Dummies Questions & Answers

Noob question about parsing a website

I'm trying to parse the website, finance.yahoo.com/q?s=ge&ql=1, and retrieve the info between <span id="yfs_l84_ge">18.98</span>, so 18.98. What would be the best way to go about this in a bash script? Any help or suggestions will be much appreciated. Thanks! (2 Replies)
Discussion started by: mayson
2 Replies

8. Shell Programming and Scripting

For loop -- noob question

Hello, I am new to shell scripting and i am trying to figure why is this not working with else statement. I am searching for every directory in that DIR i am in, however the "else" seems to be triggered whenever the run the script.. Much thanks in advance! #!/bin/shell for item in... (3 Replies)
Discussion started by: Reb0rn
3 Replies

9. Shell Programming and Scripting

Noob Expect Scripting Question

I'm having some difficulty with convincing Expect to do what I need.. I have a loop that waits for input, a specific phrase of text followed by a single word. I need Expect to capture that word following the specific phrase. It should then store the word in a variable. I'm fairly sure it's... (6 Replies)
Discussion started by: LongLeafTea
6 Replies

10. Shell Programming and Scripting

Total Noob BASH scripting question

Hello All, I have a file of ip addresses called activeips.txt What I'm trying to do is run a simple bash script that has a loop in it. The loop is a cat of the IP addresses in the file. The goal is to run 2 nmap commands to give me outputs where each address in the list has an OS... (11 Replies)
Discussion started by: Dirk_Pitt
11 Replies
DROPUSER(1)						  PostgreSQL Client Applications					       DROPUSER(1)

NAME
dropuser - remove a PostgreSQL user account SYNOPSIS
dropuser [ options... ] [ username ] DESCRIPTION
dropuser removes an existing PostgreSQL user and the databases which that user owned. Only users with usesuper set in the pg_shadow table can destroy PostgreSQL users. dropuser is a shell script wrapper around the SQL command DROP USER [drop_user(7)] via the PostgreSQL interactive terminal psql(1). Thus, there is nothing special about removing users via this or other methods. This means that the psql must be found by the script and that a database server is running at the targeted host. Also, any default settings and environment variables available to psql and the libpq front-end library do apply. OPTIONS
dropuser accepts the following command-line arguments: username Specifies the name of the PostgreSQL user to be removed. This name must exist in the PostgreSQL installation. You will be prompted for a name if none is specified on the command line. -e --echo Echo the queries that dropuser generates and sends to the server. -i --interactive Prompt for confirmation before actually removing the user. -q --quiet Do not display a response. createuser also accepts the following command-line arguments for connection parameters: -h host --host host Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. -p port --port port Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. -U username --username username User name to connect as (not the user name to drop) -W --password Force password prompt (to connect to the server, not for the password of the user to be dropped). ENVIRONMENT
PGHOST PGPORT PGUSER Default connection parameters DIAGNOSTICS
DROP USER All is well. dropuser: deletion of user "username" failed Something went wrong. The user was not removed. If there is an error condition, the backend error message will be displayed. See DROP USER [drop_user(7)] and psql(1) for possibilities. EXAMPLES
To remove user joe from the default database server: $ dropuser joe DROP USER To remove user joe using the postmaster on host eden, port 5000, with verification and a peek at the underlying query: $ dropuser -p 5000 -h eden -i -e joe User "joe" and any owned databases will be permanently deleted. Are you sure? (y/n) y DROP USER "joe" DROP USER SEE ALSO
createuser(1), DROP USER [drop_user(7)] Application 2002-11-22 DROPUSER(1)
All times are GMT -4. The time now is 07:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy