PDA

View Full Version : A weird alias issue



DMCClure13
2022-07-27, 17:15
Greeting,

I have a file /home/<user>/.aliases

#! /bin/bash

alias hid='ls -d .* --color=auto'
alias cd..='cd ..'
alias ll='ls -l'

After .bashrc runs (which calls .aliases) this is the behavior I get.

dmcclure@catspaw:~$ ll
ll: command not found
dmcclure@catspaw:~$ hid
. .bully .gnome .mozilla .steam .Xauthority
.. .BurpSuite .gnupg .msf4 .steampath .xscreensaver
.aliases .cache .hplip .openoffice .steampid .xsession-errors
.armitage .config .ICEauthority .paradoxlauncher .sudo_as_admin_successful .xsession-errors.old
.armitage.prop .dbus .icons .pki .thunderbird .zshrc
.bash_history .dmrc .java .profile .viminfo
.bash_logout .face .lesshst .pulse-cookie .vnc
.bashrc .face.icon .local .putty .wget-hsts
.bashrc.original .fltk '.~lock.Group notes for the week of February 27th.odt#' .ssh .wingpro8
dmcclure@catspaw:~$ cd..
cd..: command not found
dmcclure@catspaw:~$ alias cd..='cd ..'
dmcclure@catspaw:~$ cd..
dmcclure@catspaw:/home$

Any ideas why the cd.. alias fails and kills the rest of the aliases?

Fred Sheehan
2022-07-28, 17:35
just put any aliases you want to use in your .bashrc file or .zshrc file themselves, that's why its failing.

try..

# my aliases
alias cd1='cd ..'
alias cd2='cd ../..'
alias cd3='cd ../../..'

you get the idea lol

If you really want to keep your 'extra file' approach then don't forget to add a line on the end to 'trigger' your aliases in the shell;

source ./.bashrc

miafrance
2022-07-31, 13:45
I usually compile my code with my databases connected with a logical name, but for the moment I'm having to connect them as aliases for something.


I have code that does this:


FOR EACH ChargeRate WHERE


ChargeRate.PriceListKey = PriceList.PriceListKey AND
ChargeRate.ChargeBandKey = ChargeBand.ChargeBandKey NO-LOCK.


FIND ICMAS.BlockRange
WHERE ICMAS.BlockRange.BlockRangeKey = ICMAs.ChargeRate.BlockRangeKey NO-LOCK NO-ERROR.


When I compile with a logical dbname of ICMAS is compiles fine, but when I try and compile with aliases I get


** Missing FOR, FIND or CREATE for a table with BlockRangeKey in current block. (232)


If I qualify the ChargeRate for each with ICMAS. then it also compiles ok.


Regrettably, I have about 250 pieces of code showcasing this archery pick (https://archerypick.com/), and rectifying them currently isn't feasible (though it might be an interesting project for a minion in the future!).

Short of connecting with the right logical dbname, is there anything I can do to get my alias compile to work properly?

Fred Sheehan
2022-08-01, 01:14
FIND ICMAS.BlockRange
WHERE ICMAS.BlockRange.BlockRangeKey = ICMAs.ChargeRate.BlockRangeKey NO-LOCK NO-ERROR.

shouldn't that be ICMAS after the = and not ICMAs and no full stop after NO-LOCK NO-ERROR

miafrance
2022-08-03, 20:59
FIND ICMAS.BlockRange
WHERE ICMAS.BlockRange.BlockRangeKey = ICMAs.ChargeRate.BlockRangeKey NO-LOCK NO-ERROR.

shouldn't that be ICMAS after the garage flooring McAllen (https://www.rgvconcretestain.com/garage-flooring)= and not ICMAs and no full stop after NO-LOCK NO-ERROR



thank you so much for your suggestion really helpful (https://pakipackages.com/jazz/jazz-call-packages/) for me