Sponsored Content
Top Forums Shell Programming and Scripting Not able to create alias in bash Sun solaris Post 302671145 by krsnadasa on Friday 13th of July 2012 07:14:03 AM
Old 07-13-2012
Not able to create alias in bash Sun solaris

Hello Friends,

I am facing problem in creating aliases.

I am working in SunOS 5.10. When I login in system i have been given ksh shell.

What i am doing is that ?

I am changing shell to bash then I am creating 2 alias in command prompt like:
Code:
alias deploy_dir=' cd /opt/home/deploy/'
alias log_dir=' cd /opt/home/javalogs/'

It is working fine in command prompt. But when kept these 2 cmds in shell script and executed it gives error like:
myalias.sh:
Code:
#!/bin/bash
alias deploy_dir=' cd /opt/home/deploy/'
alias log_dir=' cd /opt/home/javalogs/'

Scripts run successfully but when i tried to type:
bash-3.00$ deploy_dir
bash: deploy_dir: command not found
bash-3.00$ log_dir
bash: log_dir: command not found

Please suggest what is wrong?

Thanks
Krsna
 

10 More Discussions You Might Find Interesting

1. Programming

Create an alias

I want to create an alias that will grep the passwd file for the logged in persons username and then it will return the password file entry. I want to pipe the whoami info to the grep command. I have created the following: % alias whopw grep... (1 Reply)
Discussion started by: mozark
1 Replies

2. Solaris

Can i create pcfs partition using sun solaris 10 ?

Can i use the sun solaris 10 to create Fat32 partition ? and i have another question im so confused between format command an fdisk within it, and mkfs and newfs, well what i got is that i have to use format to create partition physcially in my hard disk then i have to use mkfs or newfs (which is a... (2 Replies)
Discussion started by: XP_2600
2 Replies

3. UNIX for Dummies Questions & Answers

How to create a alias with an argument

If I want to create an alias called "cdr", and this alias need an argument (for example arg1)followed by "cdr", the result should go to the directory like "/home/ting/arg1/report/logs", the command should look like below, alias cdr arg1 "cd /home/ting/\!$1/report/logs" (not working)::( ... (1 Reply)
Discussion started by: ting123
1 Replies

4. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

5. UNIX for Dummies Questions & Answers

Create Alias on Desktop

Hi, I just need a simple UNIX command to send out over ARD that will create an alias to an application and place it on the desktop. Thanks (0 Replies)
Discussion started by: yodomino6
0 Replies

6. Shell Programming and Scripting

Need to create an ALIAS....

Hi GUYS, I need to create an alias for the the connect statement. I want to replace "CONNECT TO DBNAME" to "CONNECT TO DBNAME user USERID using PASSWORD" I thought i will add an alias in the .profile. But its not working. May be because i am trying to create it for 3 words instead of one... (2 Replies)
Discussion started by: mac4rfree
2 Replies

7. Shell Programming and Scripting

linux bash script to sun solaris

Hi guys, I seek a solution for this action for Sun solaris. find /sapmnt/${up}/global -prune -printf "%m %M %u %g %p\n" > $DAT1 The Application/Utilities in Sun Solaris are to old and cant understand "-printf". An update for Application/Utilities is exist, but not possible to implement... (6 Replies)
Discussion started by: ixibits
6 Replies

8. Solaris

Create Unix printer in sun Solaris

Guy's Can anyone explain how to Create Unix printer in Solaris what's the exact steps to create Unix direct printer ? (3 Replies)
Discussion started by: Mr.AIX
3 Replies

9. Shell Programming and Scripting

Create an alias

I want to create an alias cpage4 and create a postscript file For example I want to call cpage4 file.f which creates the file file.ps I have written like this but don't know how to continue alias cpage4 '/usr/bin/mpage -m40 -4AHP- \!* (6 Replies)
Discussion started by: kristinu
6 Replies

10. 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
suspend(1)							   User Commands							suspend(1)

NAME
suspend - shell built-in function to halt the current shell SYNOPSIS
sh suspend csh suspend ksh suspend DESCRIPTION
sh Stops the execution of the current shell (but not if it is the login shell). csh Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su. ksh Stops the execution of the current shell (but not if it is the login shell). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5) SunOS 5.11 15 Apr 1994 suspend(1)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy