Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Using alias after issuing 'su - user' Post 302964151 by MadeInGermany on Monday 11th of January 2016 12:37:40 PM
Old 01-11-2016
Try
Code:
PS1='\u@\h:$PWD>'

That's bash.
Other shells might take
Code:
if [ -z "$USER" ]; then
 export USER
 USER="$LOGNAME"
 if [ -z "$USER" ]; then
  USER=`PATH=/bin:/usr/bin:/usr/ucb whoami`
 fi
fi
if [ -z "$HOST" ]; then
 HOST=`uname -n | cut -f1 -d.`
 export HOST
fi
PS1='$USER@${HOST}:$PWD>'


Last edited by MadeInGermany; 01-11-2016 at 01:55 PM..
This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unix question: user supplied input for 'alias'

I have a program to scan the log files and I want to pipe the output to 'less'. I want to create an alias such that following are equivalent scanlog chunky.lst = /udd/n2man/utils/scanlog chunky.lst|less where chunky is user supplied file which can change. Is this possible as an alias or... (1 Reply)
Discussion started by: ospreyeagle
1 Replies

2. Linux

Error in issuing a make and make install

Hi, Recently I install a package and try to do a make and make install. However, in the make it gives me below error:- make:Nothing to be done for 'install-exec-am' make:Nothing to be done for 'install-data-am' Can anyone please explain to me what does this mean? I have been trying... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

3. Shell Programming and Scripting

Setting alias for a user - Linux ubuntu

Hi i have a user "SYSTEM" i want to set the below command in his .profile for an alias: who | awk '{print $1}'| sed '/SYSTEM/d' | sed '/root/d' |xargs -i pkill -u {} i tried as below: alias stop = " who | awk '{print $1}'| sed '/SYSTEM/d' | sed '/root/d' |xargs -i pkill -u {}" ... (3 Replies)
Discussion started by: joycesolomon
3 Replies

4. UNIX for Advanced & Expert Users

Issuing a Here Document as a Single Line Command

How can I run a here document on just one line? I ask, because I need to issue it from C++ as a system() or similar command and for security reasons I don't want to write out a shell script file from the program and run it. For example, how could I write: passwd test <<EOF n3wp3ss... (3 Replies)
Discussion started by: BrandonShw
3 Replies

5. UNIX for Dummies Questions & Answers

Create alias files (not alias commands)

If one: $ find -name 'some expression' -type f > newfile and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory. I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies

6. Shell Programming and Scripting

Matching user alias's to their ID's in the passwd file

Hi, I've a user alias file in the below format.. I need to change all the ID's that come after the = sign (with some multiple ID's which are separated by comma's) to their respective users that are contained in the passwords file.. Whats the best way to go about this.. Some sort of sed command in... (2 Replies)
Discussion started by: Jazmania
2 Replies

7. Red Hat

Postfix - want to send email to some non-existent user using alias

Hi, I know how to use email redirection using /etc/aliases file + postfix combination and it is working fine for existing users. The question I have is: I want to send an email to tony@server1.example.com while tony user is actually not there. Rather, I want to redirect that email to... (0 Replies)
Discussion started by: freebird8z
0 Replies

8. UNIX for Dummies Questions & Answers

Time command issuing all zeroes

I am trying to issue the time command on a program so I can see execution times but it is returning all zeroes. Like this: time pdriver arg1 arg2 0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w "0+0k 0+0io 0pf+0w" --> The "0+0io" may change sometimes to a different number. How can I run the... (2 Replies)
Discussion started by: lamentofking
2 Replies

9. Homework & Coursework Questions

Time command issuing all zeroes (is now considered homework help)

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: A common problem arising in games and simulations is to generate a random arrangements of integers from 1 to N.... (5 Replies)
Discussion started by: lamentofking
5 Replies

10. Shell Programming and Scripting

Add file extensions to files EXCEPT the script that is issuing

Greetings all, On a RedHat System - I am issuing a command from script.sh that will add a file extension to a listing of files in a directory. It works, but I need to script from having an extension added as well. Here is what I have tried to no luck: for file in `ls * | awk ' /\./{print... (6 Replies)
Discussion started by: jeffs42885
6 Replies
Balsa(1)							       2.0.6								  Balsa(1)

NAME
Balsa - the GNOME email client. SYNOPSIS
balsa [--help] [--version] [-c] [--checkmail] [-m USER@HOST.TLD] [--compose=USER@HOST.TLD] [-a FILENAME] [--attach=FILENAME] [-o MAILBOX] [--open-mailbox=MAILBOX] [-u] [--open-unread-mailbox] [-d] [--debug-pop] DESCRIPTION
Balsa is an e-mail reader. This client is part of the GNOME desktop environment. It supports local mailboxes, POP3 and IMAP. For help on using Balsa, see the program documentation in the help menu. OPTIONS
-c, --checkmail Balsa will immediately check for new mail when the program is launched -i, --open-inbox Balsa will open the Inbox on startup. -m USER@HOST.TLD, --compose=USER@HOST.TLD When invoked with this option, balsa will open a new message with the specified address in the To: field. The parameter can be spec- ified also in URL format - it makes it possible to use balsa as mailto protocol handler by setting the mailto protocol command to balsa -m "%s" in URL handlers section of GNOME control center. -a FILENAME, --attach=FILENAME When invoked with this option, balsa will open a new message with the specified file already attached to the message. -o MAILBOX, --open-mailbox=MAILBOX Balsa will open automatically at startup the mailbox or mailboxes specified on the command line with this option. Multiple mail- boxes are delimited by semicolons. -u, --open-unread-mailbox Open the first unread mailbox when balsa is launched. -d, --debug-pop Dumps the POP3 communication to stderr. Useful for debugging POP3 connections. WEBSITE
http://balsa.gnome.org/ SUGGESTIONS AND BUG REPORTS
Any bugs found should be reported to the Balsa Developer mailing list at balsa-list@gnome.org or you may want to make use of the online bug-tracking system available on the web at http://bugzilla.gnome.org/. See http://balsa.gnome.org/bugs.html for more information on reporting bugs. Before reporting bugs, please check to see if the bug is mentioned in the FAQ's or the mailing list archive. See the section on Other Info for locations of these. When reporting Balsa bugs, it is important to include a reliable way to reproduce the bug, version number of Balsa (as well as GTK and GNOME), OS name and version, and any relevant hardware specs. If a bug is causing a crash, it is very useful if a stack trace can be provided. And of course, patches to rectify the bug are even better. AUTHORS
See the AUTHORS file included with Balsa, probably at /usr/share/doc/balsa-2.0.6/AUTHORS FILES
~/.gnome2/balsa Balsa's preferences file. ~/.gnome2_private/balsa Balsa's POP and IMAP passwords file. SEE ALSO
mailcap(5) metamail(1) sendmail(8) COPYRIGHT
(c) 1997-2003 Stuart Parmenter and others, see AUTHORS for a list of people. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation. Version 03 January 2003 Balsa(1)
All times are GMT -4. The time now is 04:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy