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 from the who command:
I do not want the IP addresses that come in the standard who command so I know I would need to cut somehow but Im lost between that and pacing those headers above the top of the file.
So far Ive come up with this.....
Problem is my headers are not lined up over the output. What would be the best way to handle this? Just a hint owuld be good and I will research the rest! :-)
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 \t in the echo is something I havnt seen. When should this be used?
Thanks for all your help!
---------- Post updated at 08:44 AM ---------- Previous update was at 08:38 AM ----------
Oops got it, just found it on the man page!! THANKS AGAIN!!!
---------- Post updated at 10:23 AM ---------- Previous update was at 08:44 AM ----------
Ive been at this for days now and come up with two ways to pull the info out of the WHO command that I need....
OR
I can get the first one to match up fine with the headers I made using an echo but the grep method does not align. Just out of curiousity is there a way to make my second example align?
Last edited by Scott; 02-06-2011 at 11:37 AM..
Reason: Code tags, please...
I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place.
What I need
The following command is placed at the prompt:
TICLI... (4 Replies)
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
I ran the following command.
cat abc.c > abc.c
I got message the following message from command cat:
cat: abc.c : input file is same as the output file
How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
exam is a ksh script. In command line I enter: exam 3 param_2 param_3 param_4.
In exam how can I get the value of the parameter which position is specified by the first argument.
Simply doing this DOES NOT work:
offset=$1
value=$$offset
can you figure out any possible way to interpret a... (5 Replies)
Hi folks,
Please advise which command/command line shall I run;
1) to display the command and its output on console
2) simultaneous to save the command and its output on a file
I tried tee command as follows;
$ ps aux | grep mysql | tee /path/to/output.txt
It displayed the... (7 Replies)
Hello,
I have the following line in one of my shell scripts. It works fine when the search string($SERACH_STR) exists in the logfile($ALERTLOG) but if the search string does not exist this line errors out at run time. Is there a way to make this line return 0 if it is not able to find the... (4 Replies)
I don't understand this, can anyone explain the evaluation logic used here, and I would really appreciate a general explanation for it.
----------------------
Here's the korn script:
--------------------
#! /usr/bin/ksh
if ]
then
echo true
else
echo false
fi
if (( 2 > 10 ))
then... (1 Reply)
I'm new to unix, and I was wondering how would you output the following date using the date command? Thank you in advance.
November 4,2005 17:04:31 EST Wednesday (1 Reply)