Closed xlr-8 closed 10 years ago
I believe the problem comes from the get_aliases function.
According to my tests:
lshell:~$ ll Get_aliases: line-in => ll Get_aliases: line-out => ls -l CMD: "ls -l" total 4 -rwxr-xr-x 1 lshell lshell 9 Jun 28 01:40 export-var.txt -rw-r--r-- 1 lshell lshell 0 Jun 28 00:59 test1 -rw-r--r-- 1 lshell lshell 0 Jun 28 00:59 test2 lshell:~$ lshell:~$ echo "OK" && ll Get_aliases: line-in => echo "OK" && ll Get_aliases: line-out => echo "OK" && ll CMD: "echo "OK" && ll" OK sh: ll: command not found
I'm thinking of a patch where we could check for aliases at every 'beginning' (after ||, &&, ;, etc), however I feel like it doesn't make much sens now, and while the project is getting bigger a more serious work should be done on a proper lexer/parser; otherwise issues like this will keep on being reported.
What do you think?
Actually I believe the problem, is indeed related to https://github.com/ghantoos/lshell/issues/67
As every implemented command or aliases seem to fail:
lshell:~$ echo "test" && history test lshell:~$ echo "test" && export VAR='OK' test lshell:~$ echo $VAR lshell:~$ export VAR='OK' && echo "test" lshell:~$ echo $VAR OK
@xlr-8 it you could check that everything works fine now, it would be great! :)
Will do
Hey, got couple minutes to try it out. Problem still occurs to me - and as said more general than only aliases; builtins also impacted:
Used the same test as before:
lshell:~$ help cd clear echo exit export help history ll lpath ls lsudo sleep lshell:~$ echo "OK" && ll # alias OK sh: ll: command not found lshell:~$ echo "test" && history # builtin test lshell:~$ echo "test" && export VAR='OK' # builtin test lshell:~$ echo $VAR lshell:~$ export VAR='OK' && echo "test" # builtin lshell:~$ echo $VAR OK lshell:~$
I double checked and have your latest commit, sorry! :(
Just tested, and it works fine over here. It looks to me that you have lshell installed in your system's python libraries?
Can you test by adding the current directory in the PYTHONPATH?
git clone git://github.com/ghantoos/lshell.git
cd lshell
export PYTHONPATH=$PWD/
./bin/lshell
Thanks!
Oops , indeed the other version messing with this one! Sorry. Does work fine for aliases, still the issue for builtins, but think we can leave this issue closed! Thanks
:+1:
Aware of this issue: https://github.com/ghantoos/lshell/issues/67
I believe this one is similar but not implying builtins such as cd but aliases instead.