You are not logged in.

#1 2008-06-02 17:59:31

Husio
Member
From: Europe
Registered: 2005-12-04
Posts: 359
Website

How to write it to work on Fish shell?

I have wrote a command, that works in bash, but won't in fish.

var=$(dmenu_path | dmenu); exec $var

How to rewrite it to fish shell?

Offline

#2 2008-06-02 18:11:54

GGLucas
Member
From: The Netherlands
Registered: 2008-03-13
Posts: 113
Website

Re: How to write it to work on Fish shell?

Subshells in fish are started with just brackets, without the $, also, you set variables with the set command, instead of using =, it would become:

set var (dmenu_path | dmenu); exec $var

Offline

#3 2008-06-02 18:16:39

Husio
Member
From: Europe
Registered: 2005-12-04
Posts: 359
Website

Re: How to write it to work on Fish shell?

I've allready try this.

~> set var (dmenu_path | dmenu); exec $var
fish: Variables may not be used as commands. Instead, define a function like 'function var; xterm $argv; end'. See the help section for the
function command by typing 'help function'.
set var (dmenu_path | dmenu); exec $var
                                   ^

Offline

#4 2008-06-02 18:24:20

GGLucas
Member
From: The Netherlands
Registered: 2008-03-13
Posts: 113
Website

Re: How to write it to work on Fish shell?

Hm, if you can't pass variables to exec, that pretty much defeats trying to do this, maybe report this as a bug to fish ?

Offline

Board footer

Powered by FluxBB