Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor shell cleanups #9

Merged
merged 2 commits into from
Nov 7, 2014
Merged

Minor shell cleanups #9

merged 2 commits into from
Nov 7, 2014

Conversation

SEJeff
Copy link
Contributor

@SEJeff SEJeff commented Oct 30, 2014

Remove some duplication, and determine the script name from $0 instead of hardcoding it.

Remove some duplication, and determine the script name from $0 instead of hardcoding it.
@sue445
Copy link
Owner

sue445 commented Oct 31, 2014

thx!

mkdir -p $ARC_DIR/plugins
mkdir -p $ARC_DIR/jobs
mkdir -p $ARC_DIR/users
mkdir $ARC_DIR/{plugins,jobs,users}
Copy link
Owner

Choose a reason for hiding this comment

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

@SEJeff This command is failed, because $ARC_DIR is not exists.
Please add -p

example

$  export ARC_DIR=arc_dir

$ mkdir $ARC_DIR/{plugins,jobs,users}
mkdir: arc_dir: No such file or directory
mkdir: arc_dir: No such file or directory
mkdir: arc_dir: No such file or directory

$ mkdir -p $ARC_DIR/{plugins,jobs,users}

$ ls -l
total 0
drwxr-xr-x  5 sueyoshi_go  staff  170 10 31 09:55 arc_dir

$ ls -l arc_dir/
total 0
drwxr-xr-x  2 sueyoshi_go  staff  68 10 31 09:55 jobs
drwxr-xr-x  2 sueyoshi_go  staff  68 10 31 09:55 plugins
drwxr-xr-x  2 sueyoshi_go  staff  68 10 31 09:55 users

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stupid me, I'll try to fix that tonight.

    - exit 0 is implicit when there are no errors
    - Ensure $ARC_DIR is created via mkdir -p
    - Make usage stdout redirect to stderr where usage info should go
@SEJeff
Copy link
Contributor Author

SEJeff commented Nov 7, 2014

@sue445 Perhaps the latest update is to your liking?

sue445 added a commit that referenced this pull request Nov 7, 2014
@sue445 sue445 merged commit 8741649 into sue445:master Nov 7, 2014
@sue445
Copy link
Owner

sue445 commented Nov 7, 2014

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants