Extract words by position.
Section: Text and list functions
word and wordlist
makefile
makefile
FIRST := $(word 1,$(FILES))
REST := $(wordlist 2,$(words $(FILES)),$(FILES))Explanation
Handy when manipulating word lists.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Text and list functions
subst replace text
Replace every occurrence of one string with another.
strip whitespace
Trim extra leading, trailing, and repeated internal whitespace.