08-13-2009
Problem using a top command alias in my profile
Hi-
I am newish to the mac osx unix interface. I want to set up top so that it always displays the username. I can use this command to do this:
top -ocpu -P ' PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE USER' -p '$aaaa ^bbbbbbbbb $cccc $wwwwwww $ee $ffff-$ggggg $hhhh- $iiii- $jjjj- $llll- $nnnnnnnn'
This works great! The username displays last each time.
BUT, since I always want top to act this way, I put this into my etc/profile file as an alias, just the same way:
alias top="top -ocpu -P ' PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE USER' -p '$aaaa ^bbbbbbbbb $cccc $wwwwwww $ee $ffff-$ggggg $hhhh- $iiii- $jjjj- $llll- $nnnnnnnn'"
This does NOT work. When I do top, I get this on each PID line:
top % - - - - -
???what am I doing wrong???
This is a mac running osx 10.5 server.
Thanks!
Mike
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hello guys...
im just new in using unix and im trying to create a command by using an "alias" and incoporating it in my .profile.
how can i make a command that will do a chmod 775 on all files only under my username.
i tried
alias gochmod="chmod 775 $PUROOT/path/*"
but this gives me... (3 Replies)
Discussion started by: davinxi
3 Replies
2. UNIX for Dummies Questions & Answers
Can some body please let me know what would be the o/p of the below process
run 'top' command
then type O
then in new screen Type N
you will get processes sorted by memory
then from there copy top 10 lines
and take PID for each
and do - ps -ef | grep <the PID> - for each
What would be... (2 Replies)
Discussion started by: Sgiri1
2 Replies
3. UNIX for Advanced & Expert Users
Hi,
I was trying to call "script <an ip add>" command from .profile file to log everything whenever anyone logs in to this user. I did the following at the end of .profile. 1) Extracted the IP address who logged in 2) Called script < ip add> . The problem I am facing is all, aliases etc. written... (3 Replies)
Discussion started by: amicon007
3 Replies
4. AIX
Is there a 'top' command equivalent in AIX 4.2 ?
I already checked and I do not see the following ones anywhere:
top
nmon
topas (1 Reply)
Discussion started by: Browser_ice
1 Replies
5. UNIX for Dummies Questions & Answers
Please could someone advise me the command - to set up aliases commands within a .profile using shell sh
regards
venhart (13 Replies)
Discussion started by: venhart
13 Replies
6. UNIX for Dummies Questions & Answers
Hi!
All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Discussion started by: dancerat
6 Replies
7. Shell Programming and Scripting
Hi to all,
I'm facing some problems when adding an alias like:
#alias list="ls -al | awk '{ print $1, $2, $3, $4, (($5/1048576))"\t", $6, $7, $8, $9 }'"
and when I enter:
#list
I get:
Syntax Error The source line is 1.
The error context is
{ print >>> , <<<
awk:... (3 Replies)
Discussion started by: enux
3 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Here is what I am supposed to do, word for word from my assignment page:
1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies
9. Shell Programming and Scripting
Please forgive me if this is too stupid a question as I am fairly new to scripting.
I have an alias in my .profile (ksh) like this:
alias ff='find . -name $1'
The idea is to find all files in current dir and all subdir with the name specified in the param passed. So, I issue the command:... (8 Replies)
Discussion started by: sssccc
8 Replies
10. UNIX for Dummies Questions & Answers
Hi,
Below is what i have in my profile:
alias wldm='cd /opt/app/wls'
If i use bash or ksh shell this alias does not work.
What should be done for this alias to work with all these simultaneously -> No Shell, bash shell, and ksh shell (14 Replies)
Discussion started by: mohtashims
14 Replies
OSX(1) osx OSX(1)
NAME
osx - An SGML System Conforming to International Standard ISO 8879 -- Standard Generalized Markup Language
SYNOPSIS
osx [-Cehilprvx] [-bencoding] [-ccatalog_file] [-Ddirectory] [-ffile] [-wwarning_type] [-xxml_output_option...] [sysid...]
DESCRIPTION
osx converts SGML to XML. osx parses and validates the SGML document contained in sysid and writes an equivalent XML document to the stan-
dard output. osx will warn about SGML constructs which have no XML equivalent.
OPTIONS
The following options are available:
-bencoding
Use encoding for output. By default osx uses UTF-8.
-cfile
Use the catalog entry file file.
-C
This has the same effect as in onsgmls(1).
-Ddirectory
Search directory for files specified in system identifiers. This has the same effect as in onsgmls(1).
-e
Describe open entities in error messages.
-ffile
Redirect errors to file. This is useful mainly with shells that do not support redirection of stderr.
-iname
This has the same effect as in onsgmls(1).
-v
Print the version number.
-wtype
Control warnings and errors according to type. This has the same effect as in onsgmls(1).
-xxml_output_option
Control the XML output according to the value of xml_output_option as follows:
no-nl-in-tag Don't use newlines inside start-tags. Usually osx uses newlines inside start-tags so as to reduce the probability of
excessively long lines.
id Output attribute declarations for ID attributes.
notation Output declarations for notations.
ndata Output declarations for external data entities. XML requires these to be NDATA. osx will warn about CDATA and SDATA external
data entities and output them as NDATA entities.
cdata Use XML CDATA sections for CDATA marked sections and for elements with a declared content of CDATA.
comment Output comment declarations. Comment declarations in the DTD will not be output.
lower Prefer lower case. Names that were subjected to upper-case substitution by SGML will be folded to lower case. This does not
include reserved names; XML requires these to be in upper-case.
pi-escape Escape &<> in the contents of processing instructions using the amp, lt and gt entities. This allows processing instruc-
tions to contain the string >?, but requires that applications handle the escapes.
empty Use the <e/> syntax for element types e declared as EMPTY.
attlis Output an ATTLIST declaration for every element specifying the type of all attributes. The default will always be #IMPLIED.
Multiple -x options are allowed.
SEE ALSO
onsgmls(1)
AUTHORS
James Clark, Jane Peers <jane.peers@looksystems.co.uk>.
OpenJade January 2002 OSX(1)