WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Alias persistence  (Read 1754 times)

Offline ferran

  • Full Member
  • ***
  • Posts: 159
Alias persistence
« on: April 23, 2020, 02:20:11 PM »
I created 2 alias to make more easier the editing and executing the python's programs:

ged = `gedit -w`
py = `python3.6`

First I looked that we don't have .bashrc but yes .ashrc

I edited .ashrc adding my alias in it. But when I opened the terminal automatically ran the gedit editor & python3.6 without I query it  :o

Where I can to store my alias without those issues?
TC CorePlus v.11.1 i686 & lots of coffe

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11410
Re: Alias persistence
« Reply #1 on: April 23, 2020, 03:50:20 PM »
Hi ferran
Take a look in  ~/.profile.

Offline ferran

  • Full Member
  • ***
  • Posts: 159
Re: Alias persistence
« Reply #2 on: April 23, 2020, 04:54:57 PM »
Rich:
I just added my alias into ~/.profile but it don't works:

Code: [Select]
tc@box:~$ ged
sh: ged: not found
tc@box:~$ py
sh: py: not found
tc@box:~$

Maybe i need restart the computer?
TC CorePlus v.11.1 i686 & lots of coffe

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Alias persistence
« Reply #3 on: April 23, 2020, 04:59:07 PM »
Most aliases are setup in ~/.ashrc

Check your original format, it's wrong.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11410
Re: Alias persistence
« Reply #4 on: April 23, 2020, 05:07:11 PM »
Hi ferran
Ignore my last post, Greg Erskine is correct. Copy the syntax used in  ~/.ashrc.

Offline ferran

  • Full Member
  • ***
  • Posts: 159
Re: Alias persistence
« Reply #5 on: April 23, 2020, 05:30:28 PM »
Thank you to both.

I got a syntax error typing with " ` " instead " ' ". With:

Code: [Select]
echo "alias ged='gedit -w'" >> ~/.ashrc
echo "alias py='python3.6'" >> ~/.ashrc

Now f.i. I can to do:
ged <name of script> to edit it.
py <name of script.py> to execute it.

Now it works fine ;D

Problem solved Rich !
« Last Edit: April 23, 2020, 05:44:55 PM by ferran »
TC CorePlus v.11.1 i686 & lots of coffe