Hot answers tagged

4

That's because you have a space between the path and the $1. Try this instead: function chef(){ /opt/chefdk/embedded/bin/"$1" }


2

I'm (brand) new to zsh, so this could probably be improved: tile_lengths=() num=19 times=6 repeat $times { tile_lengths+=( $num ); ((--times)) } num=18 times=9 repeat $times { tile_lengths+=( $num ); ((--times)) } print $tile_lengths 19 19 19 19 19 19 18 18 18 18 18 18 18 18 18 Inspired by terdon's answer, I think this is a cleaner variation of my ...


2

First of all, I can’t reproduce the results you claim for the command you showed.  I got the files being renamed to another directory_file1.jpg, another directory_file2.jpg, etc., but still under the some directory directories. Secondly, because of the depth of your directory structure, you should be using -mindepth 4 instead of 2.  Thirdly, I strongly ...


1

I propose to use a function instead: mygulp () { trap : INT; gulp || say "Gulp has crashed"; } The trap will catch Ctrl-C ("interrupt" signal) and run : command (ie. nothing). Notice also || instead of ; - this way if gulp exits normally (you didn't press ctrl-c) then nothing happens, but if exit code is not zero then say command will start. This ...


1

How about: % tile_lengths=( $(repeat 25 echo 19; repeat 30 echo 18 ) ) % echo $tile_lengths 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 For other shells, you could do something like: $ ...


1

The point of RPROMPT is to be on the same line as the command you type. I'm not even sure if you can have a multiline RPROMPT (except by including some cursor motion commands in it). If you want a multiline prompt with something on the right of the first lines, include that in the left prompt. The variable COLUMNS contains the terminal width. Here's one way ...



Only top voted, non community-wiki answers of a minimum length are eligible