Welcome, Guest. Please login or register.

Author Topic: Autostart alias script at boot  (Read 1666 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jedcooperTopic starter

  • Jr. Member
  • **
  • Join Date: Oct 2009
  • Posts: 51
    • Show only replies by jedcooper
Autostart alias script at boot
« on: September 24, 2012, 08:41:51 AM »
i want to set custom aliases mainly used in shell to make things easier.

sample script S:Aliases
Code: [Select]
alias cd.. "cd /"
alias ls "ls -l"
etc.

problem now is it doesn't set the aliases, neither running the script from user-startup/startup-sequence, nor out of SYS:WBStartup (OS3.1).

what now?
A4000D A3640 CV64 22MB RAM 14GB HDD DVD-RAM SCSI/IDE Connexion (A2065) LAN Ext. FliFi/SD
A1200D Apollo 1230 68030@25MHz 6/10MB RAM 4GB HDD PCMCIA (CNET) LAN
3xA500 3x+512KB KickROMs 1.2/1.3/2.0 "Sidecars": 50MB SCSI HDD, 8MB RAM

 

Offline smf

Re: Autostart alias script at boot
« Reply #1 on: September 24, 2012, 09:14:48 AM »
edit s:shell-startup :)
 

Offline jedcooperTopic starter

  • Jr. Member
  • **
  • Join Date: Oct 2009
  • Posts: 51
    • Show only replies by jedcooper
Re: Autostart alias script at boot
« Reply #2 on: September 24, 2012, 09:20:02 AM »
Quote from: smf;709191
edit s:shell-startup :)

yeah solved this way.
BUT: i only have the aliases and path settings in current shell (ok, every new shell with s:shell-startup). but how can i make aliases and path information make _globally_ available? so it's available without starting a shell. and w/o using startup-sequence?

the startup-sequence sets some paths. is the loadwb (workbench) and any other started shell etc. depending on that, so the wb is a shell command/status/process? but the last command is endcli >NIL:
weird... :-/
A4000D A3640 CV64 22MB RAM 14GB HDD DVD-RAM SCSI/IDE Connexion (A2065) LAN Ext. FliFi/SD
A1200D Apollo 1230 68030@25MHz 6/10MB RAM 4GB HDD PCMCIA (CNET) LAN
3xA500 3x+512KB KickROMs 1.2/1.3/2.0 "Sidecars": 50MB SCSI HDD, 8MB RAM

 

Offline foleyjo

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 608
    • Show only replies by foleyjo
Re: Autostart alias script at boot
« Reply #3 on: September 24, 2012, 09:30:29 AM »
I'm not 100% sure what you are trying to do but I think what you want can be achieved if you  use some kind of Assign app. I think MCP allows for this.

I'm also not sure why you don't put some assign commands in the user startup. Cli has to open up before workbench starts After workbench has loaded cli is not needed hence the endcli at the end. Without this you would have the shell window on top of your workbench screen
 

Offline Zac67

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show only replies by Zac67
Re: Autostart alias script at boot
« Reply #4 on: September 24, 2012, 06:17:13 PM »
Code: [Select]
alias ls "ls -l"That may cause recursion - depending of the shell. Usually 'ls -l' is aliased to 'll'. ;)

Paths, environment etc. are inherited from the parent process - so for a shell launched from Workbench it's initially the same as Workbench's. Workbench is started from startup-sequence (or rather the boot shell running startup-sequence), so it inherits its environment from the boot shell.

Aliases are not inherited, so you need to add them to shell-startup.

Assigns are system-global, no matter by whom and when they are made.
« Last Edit: September 24, 2012, 06:23:37 PM by Zac67 »
 

Offline Fats

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 672
    • Show only replies by Fats
Re: Autostart alias script at boot
« Reply #5 on: September 24, 2012, 06:47:36 PM »
Quote from: jedcooper;709192
yeah solved this way.
BUT: i only have the aliases and path settings in current shell (ok, every new shell with s:shell-startup). but how can i make aliases and path information make _globally_ available?


In AmigaOS aliases are part of the shell; so having aliases without a shell is not possible. You could add some scripts in C: or S: with the executable flag set.

greets,
Staf.
Trust me...                                              I know what I\'m doing