This function will fail when given an argument with a space, which would be quite frustrating for a beginner, which is presumably the target audience for such a document: > mcd() { mkdir -p $1; cd $1 } It should be more like: > mcd() { mkdir -p "$1"; cd "$1"; } The trailing ";" is also required in bash for oneline blocks like this. Same goes for most of the other functions on page 70. "$@", etc. Just trying to make t…
Linux Terminal Tools [pdf]
11–20 of 57 posts
Re: Linux Terminal Tools [pdf]
#12This function will fail when given an argument with a space, which would be quite frustrating for a beginner, which is presumably the target audience for such a document: > mcd() { mkdir -p $1; cd $1 } It should be more like: > mcd() { mkdir -p "$1"; cd "$1"; } The trailing ";" is also required in bash for oneline blocks like this. Same goes for most of the other functions on page 70. "$@", etc. Just trying to make t…
a beginner would not likely quote the argument, so the point is moot... besides, what kind of savage wants a directory name with spaces?
But a beginner could still tab-complete file names and get them automatically backslashed.
Re: Linux Terminal Tools [pdf]
#13Re: Linux Terminal Tools [pdf]
#14Re: Linux Terminal Tools [pdf]
#15Re: Linux Terminal Tools [pdf]
#16Re: Linux Terminal Tools [pdf]
#17Should include CTRL-Q and CTRL-S, as I've encountered students who accidentally hit CTRL-S instead of CTRL-X and then stare at a hung terminal wonder WTF just happened.
Re: Linux Terminal Tools [pdf]
#18Re: Linux Terminal Tools [pdf]
#19pdf :(
Re: Linux Terminal Tools [pdf]
#20Earlier quoted context omitted.
a beginner would not likely quote the argument, so the point is moot... besides, what kind of savage wants a directory name with spaces?
> a beginner would not likely quote the argument, so the point is moot... But a beginner could still tab-complete file names and get them automatically backslashed.