Query regarding alias and setting bash as a default script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Query regarding alias and setting bash as a default script
# 1  
Old 07-13-2005
Query regarding alias and setting bash as a default script

Hi All,
I am setting bash as my working shell in my .profile file.
So I have written a line :
bash
as the list line in my .profile
I want to use alias as follows:
alias me='who am i'
When i log in, as expeced I enter the bash shell but alias doesn't work.
Is it because the alias is defined for other shell than bash??

thanks
ven
# 2  
Old 07-13-2005
Quote:
Is it because the alias is defined for other shell than bash?
Exactly. You define the alias and then start a child process into bash - until you exit out of the child process, none of your alias would work UNLESS you put them in the 'profile' that bash may use BUT that may also give you an endless loop of going into new shells (it matters what your original shell is). Suggest you change your original shell in your account instead.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash: Setting default values for variables

I have a variable I want to use in bash script. The user will pass an argument to the script and I will store it in `arg_fql`. If the user does not pass the variable, I still never set arg_fql, but I set another variable to a default. However, if the user passes a value, `arg_fql` will be set to... (2 Replies)
Discussion started by: kristinu
2 Replies

2. Shell Programming and Scripting

Setting alias (quotes, acutes)

Hello, I'd like to have an alias to view some processes sorted: I have:ps -ef | grep pmon | awk -F" " '{ print $8" "$0 }' | sort | cut -d" " -f2- | grep -v "grep pmon" It doesn't work, however, if I put it as alias because on acutes insize awk:alias pmon='ps -ef | grep pmon | awk -F" " '{ print... (4 Replies)
Discussion started by: JackK
4 Replies

3. Shell Programming and Scripting

'Dynamic' setting of variables in bash script

Hi all, I want to dynamically set variables in a bash script. I made a naive attempt in a while loop that hopefully can clarify the idea. n=0; echo "$lst" | while read p; do n=$(($n+1)); p"$n"="$p"; done The error message is: bash: p1=line1: command not found bash: p2=line2: command... (8 Replies)
Discussion started by: jeppe83
8 Replies

4. Shell Programming and Scripting

alias setting

I want to set an alias to connect to sqlplus and also run a command while it it logs in. How can I do that? (4 Replies)
Discussion started by: som.nitk
4 Replies

5. UNIX for Dummies Questions & Answers

Setting alias with echoing embedded $ sign

I tried to set up some alias in my .profile to save typing. One of the alais i tried to set up is alais test='echo 123$acct54679abc' But when I typed in test in the command line. The echo only dispaly 123 and truncated all the string starting from the $ sign. Is there any way to display the... (6 Replies)
Discussion started by: oht
6 Replies

6. UNIX for Dummies Questions & Answers

BASH: Change alias to script to add a task

Hi. I use an alias, "homeperm" as shorthand for curl -o. Since most of what I download via cUrl is graphic image files -- jpeg files -- I'd like to be able to change this alias to a script, or use it to invoke a function, which will not only download the file but date-stamp it using Exiv2 in... (4 Replies)
Discussion started by: SilversleevesX
4 Replies

7. UNIX for Dummies Questions & Answers

bash script & sql query

Hi Guys, I would like with this script "DATA=`ora123 su -c 'echo "SET HEADING OFF;\n SET FEED OFF;\n select USER NAME, ACCOUNT_STATUS from dba_users;\n exit" | sqlplus / as sysdba -s /' ` echo $DATA >> $DAT" make a sql query, but the statement "select USER NAME, ACCOUNT_STATUS from... (6 Replies)
Discussion started by: ixibits
6 Replies

8. 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

9. Solaris

Alias setting in Solaris

Hi All, I need some information on 'Alias' setting in SUN SOLARIS.:confused: Q1. I want to know how can i set my alias here. Q2. How to view all set 'ALIAS' for me. (say /home/jdash user) Q3. Can i modify the set 'Alias' for me or for whole environment. Q4. Is Alias setting can be change... (2 Replies)
Discussion started by: jdash.ps
2 Replies

10. Red Hat

Setting an alias in Redhat

Hi Everyone, I am trying to set up alias the only way I now how, buy making entry into .bashrc file. The entry I made is alias ll='ls -lrt' It is not working as I expect. When I enter "alias" at the command line I get the following. $ alias alias l.='ls -d .* --color=tty' alias... (2 Replies)
Discussion started by: jxh461
2 Replies
Login or Register to Ask a Question