LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 01-06-2018, 12:44 AM   #1
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: win 10 | OpenBSD 6.2 | Fedora 28 | Fedora 27 Server
Posts: 319

Rep: Reputation: 121Reputation: 121
alias udb="/usr/libexec/locate.updatedb" , cant get alias to work.


hello all.

this should be easy to solve, but i cant get it to work.

my .ksh_alias has this line :
Code:
alias udb="/usr/libexec/locate.updatedb"
and .profile :
Code:
ENV=$HOME/.ksh_alias export ENV
but alias doesnt work, im stumped by this.

Code:
#udb
#/bin/ksh: udb: not found
#
OpenBSD 6.1

Last edited by //////; 01-06-2018 at 03:08 AM.
 
Old 01-06-2018, 07:11 AM   #2
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,098
Blog Entries: 5

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
It looks correct to me, except I would have this in .profile:

Code:
ENV=$HOME/.ksh_alias
export ENV <and other variables>
Shouldn't make any difference though.

As you're running this as root, I'm wondering if it's root's .profile and ".ksh_alias" you're working with or your own user's?

Are you then running the command as root in a login shell or just via su(1) without arguments?
 
Old 01-06-2018, 08:32 AM   #3
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: win 10 | OpenBSD 6.2 | Fedora 28 | Fedora 27 Server
Posts: 319

Original Poster
Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by cynwulf View Post
As you're running this as root, I'm wondering if it's root's .profile and ".ksh_alias" you're working with or your own user's?
Are you then running the command as root in a login shell or just via su(1) without arguments?
hey man.

yeah, i am editing both user's and root's .profile and .ksh_alias.
im stumped by this non working alias problem

i run that #udb command from autostarted terminal emulator, Terminator 0.98, as a root and a user.

if i run the following command on the Terminator, as root, alias udb works.
Code:
#alias udb="/usr/libexec/locate.updatedb"
if i run this command on Terminator as a user, it works.
Code:
$alias udb="sudo /usr/libexec/locate.updatedb"
not sure what that means.
 
Old 01-06-2018, 01:03 PM   #4
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,098
Blog Entries: 5

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
So if you log out and log back in, what is the result of:
Code:
$ echo $ENV
For both your user and root

?
 
Old 01-07-2018, 01:45 AM   #5
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: win 10 | OpenBSD 6.2 | Fedora 28 | Fedora 27 Server
Posts: 319

Original Poster
Rep: Reputation: 121Reputation: 121
Code:
$echo $ENV

$
Code:
#echo $ENV

#
nothing comes up.
 
Old 01-07-2018, 07:02 AM   #6
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,098
Blog Entries: 5

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
The outputs should have contained the paths to your ".ksh_alias" files.

Your $HOME/.profile isn't being sourced by that terminal emulator, probably because it's not run as a login shell. I just installed it from ports and confirmed the same behaviour. I have ksh HISTFILE set in my .profile and it's not being sourced by terminator.

It is sourced by xfce4-terminal and xterm, both set to run as login shells.

I opened terminator's preferences and set it to "run command as a login shell", now it sources it correctly.
 
1 members found this post helpful.
Old 01-07-2018, 07:02 AM   #7
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,098
Blog Entries: 5

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
The outputs should have contained the paths to your ".ksh_alias" files.

Your $HOME/.profile isn't being sourced by that terminal emulator, probably because it's not run as a login shell. I just installed it from ports and confirmed the same behaviour. I have ksh HISTFILE set in my .profile and it's not being sourced by terminator.

It is sourced by xfce4-terminal and xterm, both set to run as login shells.

I opened terminator's preferences and set it to "run command as a login shell", now it sources it correctly.
 
1 members found this post helpful.
Old 01-07-2018, 07:44 AM   #8
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: win 10 | OpenBSD 6.2 | Fedora 28 | Fedora 27 Server
Posts: 319

Original Poster
Rep: Reputation: 121Reputation: 121
thank you soo much, sir, it works now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why "alias" does not work from script file rng Linux - General 15 12-21-2017 09:16 PM
Problem "$value=`mpstat 1 1 | grep "Average"`;" Alias pipe return nothing adamlucansky Linux - General 8 09-25-2009 07:26 AM
bash equivalence of tcsh "alias em "emacs \!:1 &""? rgiggs Slackware 3 07-29-2004 02:07 AM
alias does not work until ". .bash_profile" pcoveney100 Linux - Software 4 06-04-2004 09:17 PM
/usr/libexec/ld-elf.so.1: Shared object "libgd.so.4" not found lxxy *BSD 1 12-04-2003 12:01 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration