You are not logged in.
Hi,
As you can see I have no idea about programming.
I have an app in my /home/download called look.
Only way i can call this app is to open a terminal in /home/download then type /usr/loacl/bin/look.
I'd like to just type look anywhere/any drectory and get this prog launched- just like firefox.
(I can type firefox any terminal it opens up)
I''d rather not mess with the prog look.
I thought if I can have a bin file in /root/bin which will do:
cd /home/download
/usr/local/bin/look
Is this a possibility or is there a better way.
Please don't laugh.
Regards
Ben
Arch a Day Keeps Wfie Away
Offline
well, it looks like you need a shell script, considering the need to "cd" before running the app.
Save the following:
#!/bin/bash
cd /home/download
exec /usr/local/bin/look
to a file called "mylook"
As root, mv that file to /usr/bin and run "chmod 755 /usr/bin/mylook"
From then on, you can just type "mylook". Be very careful if you name this script "look", because that aready exists:
/usr/bin/look is owned by util-linux 2.12-9
Offline
Wow! Thank you that did the trick.
My Arch is getting closer to "perfect"
Regards
Ben
Arch a Day Keeps Wfie Away
Offline
Even better would be:
#!/bin/bash
CURRENT_DIR=`pwd`
cd /home/download
exec /usr/local/bin/look && cd $CURRENT_DIR
·¬»· i am shadowhand, powered by webfaction
Offline
The last cd will never get called because "exec" completely overwrites the running process - you'd want to remove the exec if you used shadowhand's version
Offline
instead of using
CURRENT_DIR=`pwd`
for the old path you can just use a dash to cd.
cd /home/download
/usr/local/bin/look && cd -
Offline