So Yesterday I switched from Solus Linux to Fedora Linux 30, but I forgot to backup some of my dotfiles including kshrc. I am fairly new to Korn shell and do not know it well, but through memory I was able to at least get this. I did use code from several different source to recreate it. The only problem is that my prompt does not change. When I was on Solus Linux I used the korn shell source from github and now I am using Korn Shell from the copr latest ksh repo for Fedora. If anyone could help me out with my config that would be great.
The way the prompt should look like is: zoomer@fedora:[/u/l/bin]:$
An odd problem using .kshrc, if I run with this in my home login directory it works fine other than if I use 'man', where each word of the manual entry is on a seperate line ?. I'm using AIX 5.3 (it worked fine on 5.2). Anyone seen this before ? (3 Replies)
How to get the current working directory as part of the command prompt? Every time I chage the folder, my command prompt path shoud change. I am using Korn Shell. Any help is greatly appreciated. (3 Replies)
Hi,
I am facing two problems in my environment. Anyone can help on this?
Thanks in advance.
Problem 1
---------
When i login into my new unix system, only the .profile is executing.
.kshrc is not executing. But my default shell is .ksh
Any setup to be changed ?
Problem 2... (7 Replies)
In my .profile, my prompt is set like this:
set -o vi
PS1=`logname`@`hostname -s`:'$PWD>'
Is there a way to show what the history number would be of the command I'm typing in the prompt? For example, I frequently run commands then run 'history' to pull up the history number of a command... (2 Replies)
When I use "/" to look for a particular command that I typed in the current session it says
D02:-/home/user1/temp> /job
ksh: /job: not found.
D02:-/home/user1/temp>
previously it used to fetch all the commands which had job in it..
for example subjob, endjob, joblist etc...
may I... (7 Replies)
Greetings!
I have to work with a NFS user id between two hosts: A running Ksh 93 and B running pdksh 88.
My problem has to do with the custom prompt I created on A: it works like a charm and display colors:
PS1="$'\E
But I switch over to B, it all goes to hell (private info... (4 Replies)
I am trying to create my custom prompt and I have almost succeeded. Right now I have PS1='\n\\$\ '
What I have not figured out is how to make the directories bold when I'm using commands ls or ls -la.
Any idea how to do it???
Many thanx. (2 Replies)
I have used this color prompt on my servers for long time, in file ~\.bashrc
Black="\"
Dark="\"
Blue="\"
LBlue="\"
Green="\"
LGreen="\"
Cyan="\"
LCyan="\"
Red="\"
LRed="\"
Purple="\"
LPurple="\"
Brown="\"
Yellow="\"
LGray="\"
White="\"
Reset="\"
PS1="$Yellow\u@\h $LBlue\w... (4 Replies)
Hi,
I'm trying to customize the ksh prompt for users on a RHEL 6.6 system for having user@host pwd : $ and user@host pwd # in red color for root.
I think it's possible but i do not even succeded for a non root user :
I added in my ~/.kshrc :
PS1="Hello : " and it works
but when i... (4 Replies)
Hi,
I am trying to run this command to connect to each server without being prompted for the password. How can I do this in Linux redhat 7.2:
for HOST in $VIPS; do
su - Myadminid -c "ssh -o ConnectTimeout=10 $HOST 'date; hostname; pkill -9 -f -u Myadminid xx00 ; ps -ef |grep Myadminid'" ... (7 Replies)
Discussion started by: mrn6430
7 Replies
LEARN ABOUT V7
alias
alias(1) User Commands alias(1)NAME
alias, unalias - create or remove a pseudonym or shorthand for a command or series of commands
SYNOPSIS
/usr/bin/alias [ alias-name [ = string...]]
/usr/bin/unalias alias-name...
/usr/bin/unalias -a
csh
alias [ name [def]]
unalias pattern
ksh
alias [-tx] [ name [ = value]...]
unalias name...
unalias [-a]
DESCRIPTION
The alias and unalias utilities create or remove a pseudonym or shorthand term for a command or series of commands, with different func-
tionality in the C-shell and Korn shell environments.
/usr/bin/alias
The alias utility creates or redefines alias definitions or writes the values of existing alias definitions to standard output. An alias
definition provides a string value that replaces a command name when it is encountered.
An alias definition affects the current shell execution environment and the execution environments of the subshells of the current shell.
When used as specified by this document, the alias definition will not affect the parent process of the current shell nor any utility envi-
ronment invoked by the shell.
/usr/bin/unalias
The unalias utility removes the definition for each alias name specified. The aliases are removed from the current shell execution environ-
ment. The -a option removes all alias definitions from the current execution environment.
csh
alias assigns def to the alias name. The assigned def is a list of words that may contain escaped history-substitution metasyntax. name is
not allowed to be alias or unalias. If def is omitted, the alias name is displayed along with its current definition. If both name and def
are omitted, all aliases are displayed.
Because of implementation restrictions, an alias definition must have been entered on a previous command line before it can be used.
unalias discards aliases that match (filename substitution) pattern. All aliases may be removed by `unalias *'.
ksh
alias with no arguments prints the list of aliases in the form name=value on standard output. An alias is defined for each name whose value
is given. A trailing space in value causes the next word to be checked for alias substitution. The -t flag is used to set and list tracked
aliases. The value of a tracked alias is the full pathname corresponding to the given name. The value becomes undefined when the value of
PATH is reset but the aliases remained tracked. Without the -t flag, for each name in the argument list for which no value is given, the
name and value of the alias is printed. The -x flag is used to set or print exported aliases. An exported alias is defined for scripts
invoked by name. The exit status is non-zero if a name is given, but no value, and no alias has been defined for the name.
The aliases given by the list of names may be removed from the alias list with unalias.
OPTIONS
The following option is supported by unalias:
-a Removes all alias definitions from the current shell execution environment.
ksh
The following option is supported by alias:
-t Sets and lists tracked aliases.
OPERANDS
The following operands are supported:
alias
alias-name Write the alias definition to standard output.
unalias
alias-name The name of an alias to be removed.
alias-name=string Assign the value of string to the alias alias-name.
If no operands are given, all alias definitions will be written to standard output.
OUTPUT
The format for displaying aliases (when no operands or only name operands are specified) is:
"%s=%s
" name, value
The value string will be written with appropriate quoting so that it is suitable for reinput to the shell.
EXAMPLES
Example 1: Modifying a command's output
This example specifies that the output of the ls utility is columnated and more annotated:
example% alias ls="ls -CF"
Example 2: Repeating previous entries in the command history file
This example creates a simple "redo" command to repeat previous entries in the command history file:
example% alias r='fc -s'
Example 3: Specifying a command's output options
This example provides that the du utility summarize disk output in units of 1024 bytes:
example% alias du=du -k
Example 4: Dealing with an argument that is itself an alias name
This example sets up the nohup utility so that it can deal with an argument that is itself an alias name:
example% alias nohup="nohup "
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of alias and unalias: LANG, LC_ALL,
LC_CTYPE, LC_MESSAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
alias
>0 One of the alias-name operands specified did not have an alias definition, or an error occurred.
unalias
>0 One of the alias-name operands specified did not represent a valid alias definition, or an error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), ksh(1), shell_builtins(1), attributes(5), environ(5), standards(5)SunOS 5.10 17 Jul 2002 alias(1)