created a .alias, but they won't take (ksh)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting created a .alias, but they won't take (ksh)
# 1  
Old 08-02-2010
created a .alias, but they won't take (ksh)

I login with a common username, and have no access to the different login scripts for my personalizations. So for a while, I would hobble on over to a directory I made for myself, and then bring in my alias file where I would fix my backspace, create a few aliases, etc.:

Code:
$ ./.alias
$

Now it no longer works. Kinda odd, but if I create my aliases manually, they take, but via script they do not.

Ideas?

- hindesite
# 2  
Old 08-02-2010
Hi

Run it like this:

Code:
$ . ./.alias

Guru.
# 3  
Old 08-02-2010
Thanks!

Can you give this newbie a little explanation on what each part of the command means? Why mine works for running my different shell scripts, but doesn't work here? Again I appreciate it.
# 4  
Old 08-02-2010
Hi

./.alias - This opens a new child shell and runs. Its not reflected in your current shell(parent)

. ./.alias - Runs the .alias in the same shell in which you are in without invoking a sub shell, and hence the changes are reflected.

Guru.
This User Gave Thanks to guruprasadpr For This Post:
# 5  
Old 08-10-2010
I appreciate it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script won't run because hardware won't produce display

Can anyone offer any advice on how to modify the script below to work on a new system we have, that has no graphics capability? We admin the system through a serial RAS device. I've tried running the below script through the RAS and through an ssh -X session. It failed with something like "GTK... (3 Replies)
Discussion started by: yelirt5
3 Replies

2. Shell Programming and Scripting

Facing problem with Alias created through script.

Hi Guru's, I am creating alias for db instance running on a server through script, am able to create them based on /etc/oratab entries and can use successfully with the below script. #!/bin/bash SCRIPT_PATH=${HOME}/scripts/db/script... (3 Replies)
Discussion started by: venky.b5
3 Replies

3. UNIX for Dummies Questions & Answers

How to pass a parameter to an alias in ksh?

I want to do something like this: alias cd2="cd /data_saves/$(/opt/bin/util/getcustdb -i $@)" Where /opt/bin/util/getcustdb is an inhouse script to lookup customer db name based on a provided id number Then when I use the alias I can cd2 4567 and have it run "/opt/bin/util/getcustdb -i... (3 Replies)
Discussion started by: JourneyRider
3 Replies

4. Shell Programming and Scripting

how can I export an alias and use it in any shell that I want to switch to like bash, ksh

None of the aliases that I set are available if I switch to a different shell. How can I export aliases and make them available in any shell that I switch to like ksh or bash ? I tried these $>alias godata='cd /home/kc/app/data' $>alias -x godata='cd /home/kc/app/data' $>alias |... (2 Replies)
Discussion started by: kchinnam
2 Replies

5. Shell Programming and Scripting

alias is ksh

Hello, I am trying to create alias in ksh. alias m=main.ksh It's working just fine but when I log out from my session and relogin the alias is gone. How can i create a permanent alias? Thanks... (1 Reply)
Discussion started by: LiorAmitai
1 Replies

6. Shell Programming and Scripting

Alias a full path in ksh

Hi again, Maybe a stupid question but I don't know how to solve it.. I want to alias a full_PATH_command.. I mean: /usr/bin/df -Ik TO sudo /usr/bin/df I used alias df='sudo df' but the command run is /usr/bin/df.. Any idea on how to make this alias? Thanks (2 Replies)
Discussion started by: iga3725
2 Replies

7. UNIX for Dummies Questions & Answers

alias in ksh

Hi all, I want to create my own set of alias, possibly place them on a script that I can run manually as a script. I've placed the sequence of alias commands in a file then I logoff and login and run the script manually. That does not seem to work, can anyone please advise how to get this work... (2 Replies)
Discussion started by: newbie_01
2 Replies

8. UNIX for Dummies Questions & Answers

A very simple script, but alias won't work

I am new to unix and therefore I did a lot of reading before posting. So please, if this has been answered before, forgive me for re-posting and point me to the right place for the answer. I have spent many hours searching the net and read over 50 posts in this forum and even tried a few thing but... (20 Replies)
Discussion started by: sssccc
20 Replies

9. Shell Programming and Scripting

Why won't my Ksh do math with (( ))?

Hello, I'm usring Ksh on AIX 5.3. For some reason my K-Shell gives me an error when I try to use the math operators (( )). Can anyone tell me what's going on and how to fix it? Thanks so much! My K-Shell: />ls -al /usr/bin/ksh -r-xr-xr-x 5 bin bin 237420 Apr 10... (2 Replies)
Discussion started by: troym72
2 Replies

10. UNIX for Dummies Questions & Answers

Ksh Why Won't IF Statement work?

I'm trying to figure out why this if statement won't work: if || $zipcount != 6 ]] then echo ${myline} echo "ZIPCODE WARNING! ${zipcode} ${zipcount}" fi if ]] then echo ${myline} echo "STATE WARNING!... (3 Replies)
Discussion started by: developncode
3 Replies
Login or Register to Ask a Question