Skip to main content

Thread: editing my .bashrc to simplify a command


hi, want write little bit of code make easier word wordnet (the "wn" command) , add vocab list.

in other words, instead of typing
code:
wn filibuster -over && wn filibuster -over >> vocab.txt
definitions word "filibuster" , add vocab.txt, want able type
code:
d filibuster
, have know do.

tried adding .bashrc:

code:
d() { 	wn "$" -over && wn "$" -over >> vocab.txt 	}
but doesn't seem working. i've never written scripts before, don't know i'm doing wrong (or not doing). appreciated.

edit: never mind, figured out. apparently have use "${1}" instead of "$".

first, why running command twice? if goal both put output file , see on console, i'd suggest using tee (see below).

second, want replace "$" "$1".

code should be:
code:
d() { wn "$1" -over |tee -a vocab.txt }
edit: ah, see figured out.

see if works.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [all variants] editing my .bashrc to simplify a command


Ubuntu

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい