Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

bash script improvements #357

Merged
merged 1 commit into from
Sep 23, 2014
Merged

bash script improvements #357

merged 1 commit into from
Sep 23, 2014

Conversation

detiber
Copy link
Contributor

@detiber detiber commented Sep 12, 2014

  • bash_startup improvements (seeing a performance improvement of about
    36ms in parsing the default.ftcommands, also removes external calls to
    sed)
    • use parameter substitution instead of splitting with the IFS when
      reading default.ftcommands
    • escape quotes using parameter substitution instead of sed
    • replace sed in trim with parameter substitution

@@ -58,7 +58,10 @@ PS1=$PS1$(final_term_control_sequence 'B')
# Logic for terminal commands

function trim() {
echo "$1" | sed -e 's/^ *//g' -e 's/ *$//g'
local var=$1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented; also, str or text would be a more idiomatic identifier than var IMO

- bash_startup improvements (seeing a performance improvement of about
  36ms in parsing the default.ftcommands, also removes external calls to
  sed)
  - use parameter substitution instead of splitting with the IFS when
    reading default.ftcommands
  - escape quotes using parameter substitution instead of sed
  - replace sed in trim with parameter substitution
@detiber
Copy link
Contributor Author

detiber commented Sep 14, 2014

updated to address feedback.

@p-e-w p-e-w merged commit f830374 into p-e-w:master Sep 23, 2014
@p-e-w
Copy link
Owner

p-e-w commented Sep 23, 2014

Merged! Thank you for your work. I have added your name to the about dialog credits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants