Discussion:
Remove path from $fish_user_paths
(too old to reply)
Ryan Burnett
2015-03-01 22:10:05 UTC
Permalink
Raw Message
I accidentally added a path to $fish_user_paths:

set -U fish_user_paths $fish_user_paths /usr/local/php5

How can I remove this /usr/local/php5 path?
Diego Zamboni
2015-03-02 03:45:59 UTC
Permalink
Raw Message
Hi Ryan,

According to the documentation you can do:

set -e $fish_user_paths[X]

Where X is the element you want to delete (arrays start at 1 in fish).

See http://fishshell.com/docs/current/commands.html#set: <http://fishshell.com/docs/current/commands.html#set:>

"In erase mode, if variable indices are specified, only the specified slices of the array variable will be erased.”

—Diego
Post by Ryan Burnett
set -U fish_user_paths $fish_user_paths /usr/local/php5
How can I remove this /usr/local/php5 path?
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/_______________________________________________
Fish-users mailing list
https://lists.sourceforge.net/lists/listinfo/fish-users
Ryan Burnett
2015-03-02 17:17:39 UTC
Permalink
Raw Message
Hi Diego,

Thanks for your reply. When I:

set -e $fish_user_paths[1]

...I get this error:

set: Erase needs a variable name

Next I tried:

set -e $fish_user_paths[/usr/local/php5]

...and received the same error.

Any idea how I can remove the /usr/local/php5 path from my $fish_user_paths?

Thanks,

Ryan
Post by Diego Zamboni
Hi Ryan,
set -e $fish_user_paths[X]
Where X is the element you want to delete (arrays start at 1 in fish).
"In erase mode, if variable indices are specified, only the specified
slices of the array variable will be erased.”
—Diego
set -U fish_user_paths $fish_user_paths /usr/local/php5
How can I remove this /usr/local/php5 path?
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now.
http://goparallel.sourceforge.net/_______________________________________________
Fish-users mailing list
https://lists.sourceforge.net/lists/listinfo/fish-users
Diego Zamboni
2015-03-02 17:24:44 UTC
Permalink
Raw Message
Ryan,

My mistake in my initial reply, you don’t use the $ in set. This works:

set -U -e fish_user_paths[3]

—Diego
Post by Ryan Burnett
Hi Diego,
set -e $fish_user_paths[1]
set: Erase needs a variable name
set -e $fish_user_paths[/usr/local/php5]
...and received the same error.
Any idea how I can remove the /usr/local/php5 path from my $fish_user_paths?
Thanks,
Ryan
Hi Ryan,
set -e $fish_user_paths[X]
Where X is the element you want to delete (arrays start at 1 in fish).
See http://fishshell.com/docs/current/commands.html#set: <http://fishshell.com/docs/current/commands.html#set:>
"In erase mode, if variable indices are specified, only the specified slices of the array variable will be erased.”
—Diego
Post by Ryan Burnett
set -U fish_user_paths $fish_user_paths /usr/local/php5
How can I remove this /usr/local/php5 path?
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/_______________________________________________ <http://goparallel.sourceforge.net/_______________________________________________>
Fish-users mailing list
https://lists.sourceforge.net/lists/listinfo/fish-users <https://lists.sourceforge.net/lists/listinfo/fish-users>
Greg Reagle
2015-03-02 17:27:20 UTC
Permalink
Raw Message
Post by Ryan Burnett
set -e $fish_user_paths[1]
set: Erase needs a variable name
Lose the dollar sign: set -e fish_user_paths[1]

Look at the examples in 'man set'. When you use the dollar sign it
dereferences the variable, i.e. turns it into its value.
--
http://www.fastmail.com - Choose from over 50 domains or use your own
Loading...