December 17, 201114 yr Sorry I didn't reply earlier Weebo, I really appreciate your time helping me, it's just been an hectic week at work I'm baffled, but in any case here is another try. I have this command called lw (ls -l like where is) save this command in /root/lw do chmod a+rx /root/lw I get this: root@Tower:~# chmod a+rx /root/lw chmod: cannot access `/root/lw': No such file or directory root@Tower:~# also show us the output for the alias command type in alias root@Tower:~# alias alias clear='echo -e '\''\0033\0143'\''' alias d='dir' alias dir='/bin/ls $LS_OPTIONS --format=vertical' alias ls='/bin/ls $LS_OPTIONS' alias mc='. /usr/share/mc/bin/mc-wrapper.sh' alias v='vdir' alias vdir='/bin/ls $LS_OPTIONS --format=long' Is the alias mc line right? thanks again for your help! no, it is not. It is a relative path, not an explicit one. It will ONLY work if you are invoking it in a specific directory where the relative path is correct. I think it expects that you are in the "/" directory since it references a path of "./usr/share/........." You need an explicit path, not a relative one. (and it needs to point to the correct explicit full path to mc-wrapper.sh) actually there is a space in there. and the path starts from /usr/share/mc/bin/mc-wrapper.sh I'm lazy.. I would just unalias mc and see how that works for ya.
December 17, 201114 yr save the following code in /root/lw first. Then do the chmod, then run it. #!/bin/sh IFS=": " for file in $@ do for dir in $PATH do [ -f $dir/$file ] && ls -l $dir/$file done done
December 17, 201114 yr Author ok , here it goes: root@Tower:~# chmod a+rx /root/lw root@Tower:~# /root/lw mc -rwxr-xr-x 1 root root 930056 2010-02-09 19:07 /usr/bin/mc root@Tower:~# alias alias clear='echo -e '\''\0033\0143'\''' alias d='dir' alias dir='/bin/ls $LS_OPTIONS --format=vertical' alias ls='/bin/ls $LS_OPTIONS' alias mc='. /usr/share/mc/bin/mc-wrapper.sh' alias v='vdir' alias vdir='/bin/ls $LS_OPTIONS --format=long' I think I'm getting the same messages as you do. I could unalias mc, (should I?), but aren't the aliases created at boot time?
December 17, 201114 yr ok , here it goes: root@Tower:~# chmod a+rx /root/lw root@Tower:~# /root/lw mc -rwxr-xr-x 1 root root 930056 2010-02-09 19:07 /usr/bin/mc root@Tower:~# alias alias clear='echo -e '\''\0033\0143'\''' alias d='dir' alias dir='/bin/ls $LS_OPTIONS --format=vertical' alias ls='/bin/ls $LS_OPTIONS' alias mc='. /usr/share/mc/bin/mc-wrapper.sh' alias v='vdir' alias vdir='/bin/ls $LS_OPTIONS --format=long' I think I'm getting the same messages as you do. I could unalias mc, (should I?), but aren't the aliases created at boot time? with the lw command, the only mc command in your path is /usr/bin/mc so the alias is being run, and for some reason there is a problem with the alias runs. logout login unalias mc and run mc to see what happens. after that you could logout, login again. do set -x -v run mc again. (should show some diagnostic trace stuff).
December 17, 201114 yr Author logout login unalias mc and run mc to see what happens. it works after that you could logout, login again. do set -x -v run mc again. (should show some diagnostic trace stuff). here it goes: Tower login: root Password: Linux 2.6.32.9-unRAID. root@Tower:~# set -x -v root@Tower:~# mc mc + . /usr/share/mc/bin/mc-wrapper.sh MC_USER=`id | sed 's/[^(]*(//;s/).*//'` id | sed 's/[^(]*(//;s/).*//' +++ id +++ sed 's/[^(]*(//;s/).*//' ++ MC_USER=root MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$" ++ MC_PWD_FILE=/tmp/mc-root/mc.pwd.16032 /usr/bin/mc -P "$MC_PWD_FILE" "$@" ++ /usr/bin/mc -P /tmp/mc-root/mc.pwd.16032 if test -r "$MC_PWD_FILE"; then MC_PWD="`cat "$MC_PWD_FILE"`" if test -n "$MC_PWD" && test -d "$MC_PWD"; then cd "$MC_PWD" fi unset MC_PWD fi ++ test -r /tmp/mc-root/mc.pwd.16032 rm -f "$MC_PWD_FILE" ++ rm -f /tmp/mc-root/mc.pwd.16032 unset MC_PWD_FILE ++ unset MC_PWD_FILE root@Tower:~#
December 18, 201114 yr To be frank, I don't have an answer for you on what the mc wrapper does not work correctly. I do not use mc and do not know why the wrapper is there. If you can unalias the mc command and it works correctly, I would do that.
December 18, 201114 yr Author To be frank, I don't have an answer for you on what the mc wrapper does not work correctly. I do not use mc and do not know why the wrapper is there. If you can unalias the mc command and it works correctly, I would do that. Hi Weebo, thanks a lot anyway for your time and effort I appreciate it. I'll unalias mc and if needed will also unalias on the go file. Merry Christmas!
Archived
This topic is now archived and is closed to further replies.