Path in non-login shells
I just installed using the 0.7-beta cd. When running X i noticed that my path for non-login shells only includes :/bin:/usr/bin:/usr/X11R6/bin:/usr/ucb
This really confuses me :?
EDIT: nevermind, it seems to be fixed now. Logging out hadnt fixed anything, but killing xdm seemed to
EDIT #2: well the problem came back It seems to be related to starting in runlevel 5. If i boot in runlevel 3,login and startx, I have a proper PATH. If i boot in runlevel 5, login through xdm, i dont have a correct PATH. Does anyone have an idea? (I would start xdm through rc.conf but there doesnt seem to be a xdm daemon in /etc/rc.d)
The obvious solution is to set PATH in the run configuration.
I had done it but it didn't work for me because I had several run configurations, but I set PATH only in one of them. oops.
I wonder if it is possible to set PATH globally in Eclipse instead of setting it in every single run configuration.
Similar Messages
-
~/.bash_profile:
. $HOME/.bashrc
~/.bashrc:
export PATH=$PATH:$HOME/code/shell
(irrelevant lines left out)
(I have no ~/.profile, ~/.bash_login or * ~/.bash_logout. I have also never edited /etc/profile or /etc/bash.bashrc.)
I've read that in a login shell (e.g. TTY1) only the former is read, which in my case sources the latter. Running "export -p" in TTY1 gives a result consistent with this:
declare -x PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/lazar/code/shell" (/home/lazar/code/shell is only listed once)
I've also read that in a non-login shell (e.g. xterm) only the latter is read. However, when I run "export -p" in xterm or urxvt I get an unexpected result:
declare -x PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/lazar/code/shell:/home/lazar/code/shell" (/home/lazar/code/shell is listed twice!)
This implies that ~.bashrc is read twice, perhaps because .bash_profile is read in non-login shells too, even though it shouldn't be, should it? It doesn't seem to matter really, but I can't help but wonder why...
[EDIT]
I've found the answer. Exports from .bash_profile are done at boot time and *remain* active while X is active. Opening a non-login shell will cause .bashrc to export as well. Hence the duplication. My solution:
~/.bash_profile:
export PATH=$PATH:$HOME/code/shell
. $HOME/.bashrc
~/.bashrc:
(lines other than export commands)
Last edited by Lazar (2011-02-14 07:57:56)As I wondered, I think it's a problem with passwd. I don't have a dbus entry and must have missed it when I was copying things around between my version and the .pacnew. Downloading an install disc now since I can't seem to change it from the recovery console due to mounting root read-only.
I'd love to know of a way to boot that avoids starting dbus and other things that might break while still having read/write access to root. Will mark solved once I update /etc/passwd and reboot. -
Hello!
I'm new to Arch bbs, though I've been using Arch for quite some time now. So well... hi everyone!
Recently I wrote a small program for myself and I feel that more people could benefit from it - so I'm sharing.
xlsh is a simple login shell with readline functionality and PAM integration.
When run stand-alone on a virtual console it can replace the standard "login" program.
When run in cooperation with X daemon component (xlshd) it can replace XDM/GDM/KDM.
Features:
Small and simple, written entirely in C.
Easily hackable because of compact codebase (~1000 source lines).
Uses PAM for authorization and session management.
Ability to select non-default shell/window manager during logon.
Entirely keyboard driven display manager replacement (when used with xlshd) without the need for any fat libraries or GUI toolkits.
Defaults configured before compilation, some of them can be changed by setting few environment variables.
Single shell script file (/etc/xlsh/xlshrc) for customizing how xlshd launches xlsh.
Introduces a concept of "pre-login shell" known from GNU/HURD.
Only three important commands: 'login', 'reboot' and 'shutdown'.
New commands can be easily added (if you need any) by editing xlsh.c
Username autocompletion on TAB.
Zenburn color scheme by default (when run under X).
So that's it. I grew tired of xdm/gdm/kdm so I rolled out my own solution. I currently run it on all my ttys and as X login manager. Shell-like keyboard only interaction is very comfortable and simple Zenburn colorscheme fits very well into my Awesome WM look & feel (which is also Zenburn).
AUR package (xlsh-git): http://aur.archlinux.org/packages.php?ID=53520
Source code: https://github.com/Nadrin/xlsh
Project wiki: https://github.com/Nadrin/xlsh/wiki
Screenshot: https://github.com/Nadrin/xlsh/wiki/Screenshots
Let me know if you find it useful. Bug reports, suggestions and any other form of constructive criticism is very much welcome!env (xlsh)
LCLIMPORTDIR=/usr/share/splint/imports
XDG_DATA_HOME=/home/irtigor/.local/share
TERM=rxvt-unicode-256color
SHELL=/bin/zsh
XDG_SESSION_COOKIE=8c19aa75e1df23394088ae2f00001baa-1320498024.774424-1546763611
GTK2_RC_FILES=/home/irtigor/.gtkrc-2.0
LC_NUMERIC=
ANT_HOME=/usr/share/java/apache-ant
USER=irtigor
LARCH_PATH=/usr/share/splint/lib
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_CONFIG_DIRS=/etc/xdg:/etc/xdg
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/share/java/apache-ant/bin:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/irtigor/.rvm/bin
LC_MESSAGES=
HG=/usr/bin/hg
_=/usr/bin/env
LC_COLLATE=
PWD=/home/irtigor
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
LANG=en_US.UTF-8
SHLVL=3
HOME=/home/irtigor
XDG_CONFIG_HOME=/home/irtigor/.config
XDG_CACHE_HOME=/home/irtigor/.cache
LOGNAME=irtigor
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-JT1g91p7nx,guid=9befacf8c90efc2782fc6ccf0000001c
XDG_DATA_DIRS=/usr/share/:/usr/local/share/:/usr/share/:/usr/local/share/
J2SDKDIR=/usr/lib/jvm/java-6-openjdk
LC_CTYPE=en_US.UTF-8
DISPLAY=:0
J2REDIR=/usr/lib/jvm/java-6-openjdk/jre
LC_TIME=
G_BROKEN_FILENAMES=1
WINDOWID=10485770
COLORFGBG=default;default;0
TERMINFO=/usr/share/terminfo
COLORTERM=yes
OLDPWD=/home/irtigor
AUTOJUMP_DATA_DIR=/home/irtigor/.local/share/autojump
EDITOR=vim
PAGER=less
MAIL=/var/mail/irtigor
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
LESS_TERMCAP_mb=[01;31m
LESS_TERMCAP_md=[01;31m
LESS_TERMCAP_me=[0m
LESS_TERMCAP_se=[0m
LESS_TERMCAP_so=[01;44;33m
LESS_TERMCAP_ue=[0m
LESS_TERMCAP_us=[01;32m
BROWSER=firefox
DISABLE_AUTO_UPDATE=true
GREP_OPTIONS=--color=auto
GREP_COLOR=1;32
LSCOLORS=Gxfxcxdxbxegedabagacad
ck-list-sessions (xlsh)
Session1:
unix-user = '1000'
realname = '(null)'
seat = 'Seat2'
session-type = ''
active = FALSE
x11-display = ':0'
x11-display-device = '/dev/tty3'
display-device = ''
remote-host-name = ''
is-local = FALSE
on-since = '2011-11-05T12:39:44.074206Z'
login-session-id = '4294967295'
env (slim)
LCLIMPORTDIR=/usr/share/splint/imports
XDG_DATA_HOME=/home/irtigor/.local/share
SHELL=/bin/zsh
TERM=rxvt-unicode-256color
XDG_SESSION_COOKIE=8c19aa75e1df23394088ae2f00001baa-1320498147.998816-1602302550
GTK2_RC_FILES=/home/irtigor/.gtkrc-2.0
LC_NUMERIC=
ANT_HOME=/usr/share/java/apache-ant
USER=irtigor
LARCH_PATH=/usr/share/splint/lib
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_CONFIG_DIRS=/etc/xdg:/etc/xdg
MAIL=/var/mail/irtigor
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/share/java/apache-ant/bin:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/irtigor/.rvm/bin
LC_MESSAGES=
HG=/usr/bin/hg
_=/usr/bin/env
LC_COLLATE=
PWD=/home/irtigor
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
EDITOR=vim
LANG=en_US.UTF-8
SHLVL=2
HOME=/home/irtigor
XDG_CONFIG_HOME=/home/irtigor/.config
XDG_CACHE_HOME=/home/irtigor/.cache
LOGNAME=irtigor
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Ya5luICcfh,guid=74c155d555aa8c9aa358c87100000014
XDG_DATA_DIRS=/usr/share/:/usr/local/share/:/usr/share/:/usr/local/share/
J2SDKDIR=/usr/lib/jvm/java-6-openjdk
LC_CTYPE=en_US.UTF-8
DISPLAY=:0.0
J2REDIR=/usr/lib/jvm/java-6-openjdk/jre
LC_TIME=
G_BROKEN_FILENAMES=1
XAUTHORITY=/home/irtigor/.Xauthority
WINDOWID=12582922
COLORFGBG=default;default;0
TERMINFO=/usr/share/terminfo
COLORTERM=yes
OLDPWD=/home/irtigor
AUTOJUMP_DATA_DIR=/home/irtigor/.local/share/autojump
PAGER=less
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
LESS_TERMCAP_mb=[01;31m
LESS_TERMCAP_md=[01;31m
LESS_TERMCAP_me=[0m
LESS_TERMCAP_se=[0m
LESS_TERMCAP_so=[01;44;33m
LESS_TERMCAP_ue=[0m
LESS_TERMCAP_us=[01;32m
BROWSER=firefox
DISABLE_AUTO_UPDATE=true
GREP_OPTIONS=--color=auto
GREP_COLOR=1;32
LSCOLORS=Gxfxcxdxbxegedabagacad
ck-list-sessions (slim)
Session2:
unix-user = '1000'
realname = '(null)'
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0.0'
x11-display-device = '/dev/tty3'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2011-11-05T12:46:37.963456Z'
login-session-id = '1'
Session1:
unix-user = '1000'
realname = '(null)'
seat = 'Seat2'
session-type = ''
active = FALSE
x11-display = ':0.0'
x11-display-device = ''
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2011-11-05T12:46:33.690874Z'
login-session-id = '1' -
[SOLVED] tmux as login shell
Hi,
anyone tried using tmux as login shell? chsh says it is invalid.
I want tmux to attach to an existing session or else create a new one upon login if no session exists.
Putting "exec /usr/bin/tmux attach" into my ~/.bash_profile doesn't create a session if none exists.
Any ideas?
Thanks!
Last edited by awayand (2011-05-17 18:28:50)tmux is not a shell itself but a terminal multiplexer; one or more shells are running inside tmux.
You can try something like this in your .bashrc:
if [[ -z "$TMUX" ]]; then
tmux att
fi -
What is advantage of opening a terminal as a login shell?
In many websites/tutorials I see that a lot of people like to open the terminal as a login shell. Is there any particular reason or advantage to do so?
There are a few settings you'd definitely want to only apply once, such as additions to your PATH. If, for example, you add
export PATH="~/bin:$PATH"
to your ~/.bashrc, the new directory would get appended for any additional login shell you start from within your shell.
As a hands-on example: I'm opening a terminal, so ~/.bashrc is sourced for the first time. Then I'm starting ranger, a console file manager. From within ranger, I start a new subshell because I want to do some complicated task. Upon starting that subshell, my ~/.bashrc would be sourced for the second time, and my PATH variable would look like this:
$ env
PATH=/home/runiq/bin:/home/runiq/bin:<rest of PATH>
This isn't exactly a major thing, but if you throw things in your ~/.(bash_)profile and ~/.bashrc willy-nilly, it will eventually come around to bite you in the ass.
Edit: Some more examples:
You want to start a certain kind of program only once: Put it in ~/.(bash_)profile.
You want to define aliases: Put them in ~/.bashrc.
A very specific example. You'd like to use the fish shell for all your interactive shells, but you can't just do "chsh -s /usr/bin/fish" because fish is not POSIX compatible. Put the following in your ~/.bashrc:
exec /usr/bin/fish
and this bit of black magic in your ~/.bash_profile:
[[ $- == *i* ]] && source ~/.bashrc
Hope that clears things up a little.
Last edited by Runiq (2013-12-18 18:35:56) -
I was following the Archwiki guide on colouring the bash prompt and found that if I open gnome-terminal and use 'su root' I get a colourised prompt but if I used 'su - root' which I found out to be the same as 'su -l root' then I didn't.
Some further research told me that -l makes the shell a login shell but I still don't really understand what that is or how it is any different. Can anyone enlighten me? Thankyou.I may be mistaken, but I believe the major difference is that when you su using a login shell, all of the login scripts for that shell run when it is instantiated. On my system, that includes changing to the new user's $HOME.
Without the -l, the system changes to the new user, but things like the CWD and PATH remain unchanged
For the purposes of system administration where you are switching to root, I don't think it matters which you use -- unless you do or don't what to change the environment.
[edit: added a missing verb. Note to self: Don't post when you are tired]
Last edited by ewaller (2010-05-29 14:41:48) -
Hi,
I dual boot and it's been a while since I last upgraded. I booted into Arch, updated everything, and used the system for a few days before rebooting (perhaps a bad call). I just rebooted today and my login prompt is like this:
((none)) tty1
(none) login:
But my keyboard does nothing. No alt+f* to get to a different terminal, no nothing. I have to hard kill the machine. I've tried twice but would prefer not to do that more than I have to. The second time, fsck didn't work so I booted into the Arch install disk and ran it manually. I tried to chroot into my Arch install and re-run pacman -Syu but got transient server failures. Not sure what all needs to be in place to try and do that, though.
Has anyone encountered anything like this before? I get the same behavior with arch and arch fallback. I boot to login prompt, not directly to X so it's not anything to do with that, at least not that I would figure.
So far, the only thing I've been able to find is from 2007 (LINK) but it seemed related to X. I'm going to check rc.conf next time I boot up but wanted to see if there's any other suggestions from someone more experience before I boot up again and potentially have to hard kill.
Thanks for any thoughts/suggestions.
Last edited by jwhendy (2010-10-26 02:53:26)@Knute: indeed.
Somewhat embarrassingly, I just found out about manually maintaining *.pacnew files today when researching an unrelated issue. It made me wonder if that was my problem. Perhaps something is goofed in /etc which would explain a ton.
I'm in OS X right now but will reboot shortly and try to fix this issue.
The keyboard issue is troubling as well, though. Some have reported no logins, but often it's a PAM or login manager issue trying to go into X directly. I'm doing no such thing and literally can't get *anything* to work on my keyboard. That makes me wonder...
If I were to boot into the Arch CD and try to run pacman manually... what do I have to do other than
# mount /dev/sda3 /mnt
# chroot /mnt
I tried that yesterday but failed. I'm wondering if I have to mount some other items for that to work. /proc? -
Reset multiple images' clipping paths to "None"
In InDesign CS4, is there a way to check all images at once and reset their clipping paths to "none?" I work on catalogs that have several thousand photos (tif, Photoshop, and a few jpg files) in each one. We break the catalogs into approximately 10 sections/documents then organize them into a book file/palette, so there are only a few hundred images in each section/document. Originally a clipping path was applied to the photos (either a Photoshop clipping path or a "detect edges" path), but we now save them with transparency, so I'd like to be able to turn them all of at once (especially the "detect edges" paths).
Any suggestions? I know basically nothing about scripting, so writing a script wouldn't work in this case.
I appreciate any help...
Thanks,
LloydI'm not sure.
Isn't it a collection up to this:
docs[l].rectangles.everyItem().images.everyItem()
from this point it's got a length:
docs[l].rectangles.everyItem().images.everyItem().clippingPath
So this works here:
#target indesign
function main() {
var docs = app.documents.everyItem().getElements(),
l = docs.length;
while(l--) {
try {
cPaths = docs[l].rectangles.everyItem().images.everyItem().clippingPath;
pl = cPaths.length;
while(pl--){
cPaths[pl].clippingType = ClippingPathType.NONE;
} catch(e) {
alert(e);
alert('All done! You can go outside and play now!')
app.doScript('main()', undefined, undefined, UndoModes.entireScript, 'Reset Clipping');
Have a nice day
Hans-gerd Claßen -
How to modify default value of Login Shell attribute via script
Hi all,
I'm configuring the "UNIX Attributes" tab here in Active Directory Users and Computers. I've noticed that on the Login Shell option it has a default value: /bin/sh. So I had manually changed it to: /bin/bash. I just change this value one
bu one manually. Now, I want to change this value for all users via script. Could you please help me to receive this goal?
Thank you in advance.Use Get-AdUser / Set-AdObject
Get-AdUser -Filter * | Set-AdObject -Replace @{unixhomedirectory='/bin/sh','bin/bash'} -WhatIf
¯\_(ツ)_/¯ -
How to make BASH as a default login shell
Hi !
How to create BASH as a default login shell for root user?
RegardsModify root's shell entry in /etc/passwd:
root:x:0:0:Super-User:/:*/usr/bin/bash* -
Script to Save Path/File Name/login user information
Hi all,
Could anyone tell me how to solve this below problem.
· Here i Need to write a script which does the following
In Adobe Illustrator CS2, when i run script then the path information of the current open file, Filename of the file and the Login person name has to be recorded in a text file and saved onto the server. (Ex \\10.99.0.60\filehistory\ [today].txt).
· All these activity should take place simultaneously by executing the script once.
· Collect path/File name/Login information and write it to a file. After writing save it to a location in the server. All these should occur in one shot.
· For different opened files of the same day work, different information (path/File name/Login) will be collected and appended to the same text file and locations.
· Different files will be created for information about on each date.
Regards,
SanatTry This. (BTW, i am a newbie, learning Applescript now)
tell application "Adobe Illustrator"
set filePath to get file path of current document
set filePath1 to POSIX path of filePath
set userName to get short user name of (system info)
tell application "Finder"
set theFilePath to (path to desktop as string) & "test.txt" as string
set theFileReference to open for access theFilePath with write permission
set theResult to get eof of theFileReference
write filePath1 & " User Name: " & userName & return & return starting at theResult to theFileReference as string
set theResult to theResult + 1
close access theFileReference
end tell
end tell
JaiMS -
Changing login shell (user in LDAP)
When I try 'passwd -e' (to change my login shell), I get 'Permission denied'.
I have write access to the loginShell attribute (can change it with ldapmodify) but I can't tell/learn my/the users to learn LDIF and ldapmodify... !
Part of my pam.conf:
other password required pam_dhkeys.so.1 debug
other password requisite pam_authtok_get.so.1 debug
other password requisite pam_authtok_check.so.1 server_policy debug
other password required pam_authtok_store.so.1 server_policy debug
With this I can change password, and the Password Policy rules are obeyed.
Also, neither of 'passwd -[fgl]' works... Same problem:
----- s n i p -----
root@etedstst# passwd -l qturfre
passwd: Sorry, wrong passwd
Permission denied
----- s n i p -----
Resetting the password with ldapmodif works fine. I'll get asked for a new password at login.Have you tried 'passwd -r ldap -e'
$ passwd -r ldap -e
Enter existing login password:
Old shell: /bin/tcsh
New shell: /bin/ksh
passwd: password information changed for tuser -
Sorry for the stupid question, but I've been unable to figure this out. How do I change my login shell from bash to csh? Under linux I'd just edit /etc/passwd, but I don't think that's quite right under OS X (I don't even see my username listed in passwd).
What's the "correct" way to change the login shell?
Thanks,
Dave/Applications/Utilities/NetInfo Manager- Open the NetInfo Manager application. Select users in the middle column. Select your user name in the right column. Click the lock at the bottom of the window and enter your admin password. Under Property click on shell property then click were it list /bin/bash. Change the value to /bin/csh or /bin/tcsh (csh is tcsh in OS X). Click the lock to save the changes. Log out then log back in and your shell will change.
-
ZSH shows error in prompt if run as login shell
Hey there. I'm having a bit of a niggling issue with zsh. I've tried the search function to no avail.
Whenever zsh is run as a login shell, the prompt indicates that the last command returned something other than a zero. It seems to occur when using oh-my-zsh. I'm using it in combination with zgen right now, but it happened with antigen, antigen-hs as well as vanilla oh-my-zsh. I've deleted .oh-my-zsh entirely and reinstalled. The same thing happens.
I'm using urxvt as my virtual terminal, but it happens in plain-jane TTYs too. If I disable the login shell flag, it doesn't show the error at all. It occurs with any zsh theme.
See below for my .zshrc, .Xresources and .zprofile, as well as examples of what I'm referring to in the top and bottom vts in the right column.
https://i.imgur.com/qBBPAq7.jpg
Does anybody have any ideas about where I might start digging into this?
-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --jasonwryan wrote:Uninstall Oh-my-zsh: it is worse than useless.
+1 for this... use [extra]/grml-zsh-config instead. -
Finding path to source executed shell script
Hello,
I have shell script A which executes shell script B. The scripts A and B reside in the same directory.
Following requirements:
Scripts A and B need to be source executed.
The directory where A and B resides should be anywhere.
The present working directory from where A is executed should be anywhere.
The directory of scripts A and B may not be defined in $PATH.
The current shell could be any Bourne or Korn shell, Linux or Unix.
Problem:
Let's assume scripts A and B are installed in "/custom".
The users working directory is /home/oracle and he executes "source /custom/A".
If script A executes "source ./B", the result would be "source /home/oracle/B", which will fail.
Possible Solution:
Since script A is being sourced, $0 will always be the name of the current shell and not the name and path to script A.
I have not found a universal solution to locate the absolute path of a shell script that is being source executed.
So I was wondering about defining a variable in script A. e.g. SCRIPT_HOME=./custom. When script A executes "source $SCRIPT_HOME/B" it will work, but then script A needs to be customized by the user.
I could write a script C that edits script A to search and edit the SCRIPT_HOME variable. For this to work I will have to verify that script C is not source executed, and that script A is in the same directory as C based on $0. This is not a problem..
The question however is whether I need to create script C, or could simply execute script A with -config argument to edit itself and exit. I would prefer the later case and from what I understand, Unix and Linux do not lock files by default and this should be possible.
Any comments or suggestions please?
Thanks!
Edited by: Dude on Apr 5, 2011 3:59 AMThe $_ solution is actually very simple:
$ cat thatsme
mypath=$(dirname $_)
echo "$mypath/B"
$ source /home/oracle/thatsme
/home/oracle/BI do not need the absolute path of script A. The relative path from my current directory will do as well.
But, it does not work with an alias:
$ alias thatsme='source /home/oracle/thatsme'
$ thatsme
./B
Maybe you are looking for
-
How to deal with BRS for the below scenario?
Hi, I would like to know the solution for the below scenario for BRS: I have a customer who was maintaining their accounts with Tally software for their previous Financial Year. This year they have shifted to SAP B1 2005B. They have issued few cheque
-
how to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.
-
Viewing DPS folio on Content Viewer on PC
I am developing a DPS folio on a Mac for publication on iOS devices. I have a co-worker who needs to review my content on a PC. He is not using Adobe apps but has downloaded the Content Viewer on his PC. I have shared my folio with him and he can rea
-
Just got a G4 and would like to use an old LaserWriter with it but do not know about drivers. Can some one be so nice as to "walk" me through downloading the drivers from the Apple site and loading them on my G4. I am using OS 10.2.8
-
Query on Topology for working with Routing Server
Hi, We have just started working with Routing Engine. We have a sample street data. For working with routing server, whether we need the topology to be built? If we have a topology can we use with routing server? In this request for un-geocoded addre