Search Results

Search: Posts Made By: losingit
2,278
Posted By losingit
Here is what happens: I want to create a...
Here is what happens:

I want to create a script. The script will ask me to enter one argument which will be a user prefix.

My script will take the prefix and search two areas for the user....
2,278
Posted By losingit
That doesnt work. Any other ideas? Im...
That doesnt work.

Any other ideas?

Im using bash if that matters
2,278
Posted By losingit
Well Im not saying just who, I was using that as...
Well Im not saying just who, I was using that as an example. My question is this...

Lets say you have a command ... any command... that returns multiple lines when run.

Who, cat /etc/passwd,...
2,278
Posted By losingit
Need help with output
Hello,

I am trying to use the output of the who command to display some messages.

For instance, if users Joe, Jim, Sue, and Sally were generated from who I want to take that output but...
1,127
Posted By losingit
I dont get where exactly you are doing this....
I dont get where exactly you are doing this. Especially the while true. While what is true? Im a little lost as to the origin of where you are putting this while loop or what I should eb replacing...
1,127
Posted By losingit
Some getopts help needed
Hi all, so look, I know Im a newb and before you look at my question and get upset I want you to understand I have spent the last 7 days to get THIS far. Ive been reading up on getopts so much I even...
4,173
Posted By losingit
Using getopts. Need help
Hi all...

I have been looking on here for the past few days for an answer and Im gonna have to break down and ask.

I just learned about the getopts command last week so have been trying to...
4,408
Posted By losingit
Integer Expression Expected!?!?
Ok, so I am beggining a script to factor the time difference from when a user logs on to current time but before I can even get too far I am getting the INTEGER EXPRESSION EXPECTED error. Can someone...
2,844
Posted By losingit
I never heard of epoch time till just n ow. I...
I never heard of epoch time till just n ow. I went and read up on it but it seems FAR more confusing and I dont really see how exactly it would help me in this situation. You would need to be able to...
2,844
Posted By losingit
Script to determine logged in time
Hi all

So I am thinking my inability to cope with math is bogging me down here so Im asking for help.

I want to determine how long a user has been logged on for by using the date and who...
886
Posted By losingit
def not working for me. Guess ill try again...
def not working for me. Guess ill try again tomorrow.
886
Posted By losingit
Still doesnt work. Im using BASH. When I use env...
Still doesnt work. Im using BASH. When I use env in the shell the variables do not appear and shen i use SET in the vi the variables do not appear.
886
Posted By losingit
SET produces different results in a script?
Hi all,

So wondering if anyone has ever come across this...

I know if you run SET command you can see a listing of all your shell variables. HOWEVER, if you create a script in vi, and in that...
4,807
Posted By losingit
Just figured out part of what I wanna do by doing...
Just figured out part of what I wanna do by doing this:

read -p "Enter your name and age: " name age


Actually just thought of a part two to this. If this was a file named "bio" how could I...
4,807
Posted By losingit
Multiple input on same line?
Hey all. I am trying to ask the user to enter two pieces of input that I will assign to variables all in one line. So for instance... I ask this:

"Please enter your name and age:"

With the...
8,536
Posted By losingit
Ive tried that and I thought that would be it but...
Ive tried that and I thought that would be it but it also copies files without capital letters. Im looking to copy any file that contains any amount of capital letters. So if I had files named
...
8,536
Posted By losingit
Seems rather legthy just to copy files from one...
Seems rather legthy just to copy files from one directory to another though. I swear Ive seen this done before. I will keep scouring the web and post a reply when I finally find it. Itd be nice to...
8,536
Posted By losingit
Copying files with caps?
Anyone know the proper command to copy files whose names CONTAIN a capital letter to a diff location? Every time I do it I ke copying ALL the files. Here is what ive tried

cp *[A-Z]* newlocation...
920
Posted By losingit
Newbie Alert:Reversing part of a string?
Hello all,

Wondering if anyone can help me out.

Trying to cut the names out of the /etc/passwd file so that they can be displayed first then last name. I cut them out and put them into...
3,056
Posted By losingit
Sorry. Here is the pure output of the who...
Sorry. Here is the pure output of the who command. There must be a simple way to make the headers line up over the fields. Trying to figure it out with another book I just went out and bought also. ...
3,056
Posted By losingit
Thank you for your patience with me but I think...
Thank you for your patience with me but I think we are almost there!

When I use this code:

echo -e "User\tTTY\tDate\tTime"
who | grep s132a | cut -d' ' -f1,3,11,13,14 | tr ' ' '\t'

it is...
3,056
Posted By losingit
Thats amazing....THANK YOU!! Can you just...
Thats amazing....THANK YOU!!

Can you just tell me what a few things did? For instance in the first line after echo you have -e. What does -e do? I checked my text and cant find it.

Also the...
3,056
Posted By losingit
Hmmm thanks for the try but that made it worse....
Hmmm thanks for the try but that made it worse. My OS is win7 and using the bash shell.

Using my cut the way I did it comes out fine, its the header that wont line up with the columns I cut.
3,056
Posted By losingit
Here is my batch file.... echo User TTY Date...
Here is my batch file....

echo User TTY Date Time
who | cut -c1-7,9-15,23-25,28-34

Here is the input ...

User TTY Date Time
aar11 pts/2 Feb4 12:27
b11212d pts/1 Feb4 13:56
alf112 ...
3,056
Posted By losingit
Output from who command - quick riddle
Hi all.

So I have a problem. I have been doing real good figuring this stuff out on my own but Im a newbie and stuck on something that is probably real basic.

I want to get the following output...
Showing results 1 to 25 of 25

 
All times are GMT -4. The time now is 11:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy