Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Why are you defining aliases in your ./profile? Why not ~/.kshrc which would solve your problem? Commented Nov 18, 2013 at 16:09
  • Actually, I'm in a professional service, and I can't do this. I can only use ./profile. Commented Nov 18, 2013 at 16:10
  • 2
    Then either source your .profile from your script, or define the alias in your script or don't use the alias but the actual command. Why in the world can't you use ~/.kshrc? That makes no sense, if you can use .profile you can use .kshrc. Aliases have no business being defined in .profile. Commented Nov 18, 2013 at 16:13
  • @terdon /me shrugs. I use .profile to define shell-agnostic things, and then source it. see unix.stackexchange.com/questions/88201/… Commented Nov 18, 2013 at 16:38
  • to reiterate some of the sentiment above, using aliases in a script is a bad idea from the get-go. if you know what that alias is running, why don't you do something like this : (say alias is as such "mycmnd=/usr/sbin/grep") in your script you can use MYCOMMAND=/usr/sbin/grep and then everytime you need to use this command, you can reference it by $MYCOMMAND. Commented Nov 18, 2013 at 19:56