Skip to content

What does the following commands do? 🤔 #1430

Discussion options

You must be logged in to vote

set is used to modify shell options and set positional parameters. set -f disables globbing. Run

echo *
set -f
echo *

to see the effect.

~/.local/share/lf/files contains a list of files which have been marked for copying (yanking) or moving (cutting). The first line of this file indicates the mode (copy or move). Using set in this way is entirely distinct from the way it is used just above. It is simply setting the positional parameters, so that $1 contains the mode of operation, and the remaining positional parameters contain the files marked for copying or moving.

  1. bash splits parameters expansions on whitespace. It's considered good practice to quote parameter expansions to avoid unwan…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@michaelferon
Comment options

@michaelferon
Comment options

@limaceous-bushwhacker
Comment options

@michaelferon
Comment options

Answer selected by limaceous-bushwhacker
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants