The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing a shell script from windows;script present in unix rajneesh_kapoor UNIX for Advanced & Expert Users 4 05-08-2009 02:54 PM
help needed with creating challenging bash script with creating directories I-1 Shell Programming and Scripting 7 04-29-2009 05:33 AM
(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script praka Shell Programming and Scripting 6 04-15-2009 06:09 AM
Accessing aliases within a shell script cooldude Shell Programming and Scripting 9 07-18-2008 12:03 PM
RSH use for executing a script frustrated1 Shell Programming and Scripting 6 10-02-2003 08:24 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-15-2009
heetertc heetertc is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 6
Creating and Executing a script of aliases in AIX

hi, I am trying to create a script in AIX (5.3 I think), then run it. here's what I have:

[me@compy] /home/me $ vi first.aliases
...
alias cdblah='cd /blah'
alias cdho='cd /ho'
alias ssr='sudo su - random'
~

...end of first.aliases
[me@compy] /home/me $ ./first.aliases
[me@compy] /home/me $ ssr
ksh: ssr: not found.

[me@compy] /home/me $ alias ssr='sudo su - random'
[me@compy] /home/me $ ssr
[YOU HAVE NEW MAIL]
[random@compy] /home/random $[COLOR="#738fbf"]

---------- Post updated at 03:56 PM ---------- Previous update was at 03:40 PM ----------

. ./first.aliases
is how I have to run the file in order for it to work, but when I switch users, the aliases don't stick.

any idea how to fix that? maybe make it run on start-up for all users? maybe put it in /.profile ?
  #2 (permalink)  
Old 09-15-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,391
yup put them in .profile of all users...
  #3 (permalink)  
Old 09-16-2009
heetertc heetertc is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 6
Where do I put them in .profile?

The only time I can get them to work is if I leave a quote off the last alias, but that makes my profile not boot properly.
Reply

Bookmarks

Tags
aix, alias, ksh, script writing, sudo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0