You are not logged in.
Pages: 1
Hello
Today I have an idea for a script that will display all dir's (in curent directory) in dmenu and when we select one I will to it
Here it is:
#!/bin/bash
ls | dmenu -fn glisp -nb "#100" -nf "#b9c0af" -sb "#000" -sf "#afff2f" -i
cd $pwd/
Dmenu dispaly's good but after I select dir it saysi only the name of dir I select
How to cat the output of dmenu?
Thanks for help!
Last edited by SpeedVin (2009-08-11 08:16:55)
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
#!/bin/bash
cd "$(ls | dmenu -fn glisp -nb "#100" -nf "#b9c0af" -sb "#000" -sf "#afff2f" -i)"
Regards,
raf
Last edited by raf_kig (2009-08-10 19:08:57)
Offline
Unless I misunderstand you, this won't work. The cd will last until the end of the shell script and you will then be moved back to the directory the script was started from.
#!/bin/bash
cd /
ls
This little script will demonstrate that.
Last edited by rson451 (2009-08-10 19:13:20)
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
Then make it a function or an alias.
alias cdmenu='cd "$(ls | dmenu -fn glisp -nb "#100" -nf "#b9c0af" -sb "#000" -sf "#afff2f" -i)"'
Offline
Yeah, it won't work if executed, but sourcing it will work
i'd suggest using an alias like
alias bla='cd "$(ls | dmenu -fn glisp -nb "#100" -nf "#b9c0af" -sb "#000" -sf "#afff2f" -i)"'
Offline
#!/bin/bash cd "$(ls | dmenu -fn glisp -nb "#100" -nf "#b9c0af" -sb "#000" -sf "#afff2f" -i)"
Regards,
raf
Thanks
I tried your solution but it won't go to directory
Script's have exec right's .
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
As rson451 correctly said: This won't work if you execute it. You have two options:
1) source myscript.sh
instead of running it
2) use an alias like scragar/I posted
Regards,
raf
Offline
As rson451 correctly said: This won't work if you execute it. You have two options:
1) source myscript.sh
instead of running it2) use an alias like scragar/I posted
Regards,
raf
Yeah you were right thanks
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
Pages: 1