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

Create syscalls file #2754

Merged
merged 3 commits into from
Jun 14, 2019
Merged

Create syscalls file #2754

merged 3 commits into from
Jun 14, 2019

Conversation

curiosity-seeker
Copy link
Contributor

A little script to determine the necessary syscalls for a program.

A little script to determine the necessary syscalls for a program.
contrib/syscalls Outdated Show resolved Hide resolved
@Vincent43
Copy link
Collaborator

@curiosity-seeker please double quote all variables.

@curiosity-seeker
Copy link
Contributor Author

@curiosity-seeker please double quote all variables.

I'm not sure that I understand correctly. To my knowledge awk and sed do not support double quotes.

@rusty-snake
Copy link
Collaborator

@curiosity-seeker my understanding:
cat $SYSCALLS_OUTPUT_FILE -> cat "$SYSCALLS_OUTPUT_FILE"

@Vincent43
Copy link
Collaborator

@curiosity-seeker https://www.shellcheck.net/

$ shellcheck syscalls.sh

In syscalls.sh line 21:
strace -cfo $STRACE_OUTPUT_FILE "$@" && awk '{print $NF}' $STRACE_OUTPUT_FILE | sed '/syscall\|-\|total/d' | sort -u | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/' > $SYSCALLS_OUTPUT_FILE
            ^-----------------^ SC2086: Double quote to prevent globbing and word splitting.
                                                          ^-----------------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                                                                                                     ^-------------------^ SC2086: Double quote to prevent globbing and word splitting.


In syscalls.sh line 24:
cat $SYSCALLS_OUTPUT_FILE
    ^-------------------^ SC2086: Double quote to prevent globbing and word splitting.

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

@Vincent43 Vincent43 merged commit cedf414 into netblue30:master Jun 14, 2019
@Vincent43
Copy link
Collaborator

We could change (pwd) to PWD but nevermind. Merging as all feedback was addressed.

rusty-snake pushed a commit that referenced this pull request Jun 18, 2019
* add link to wiki
* now link to contrib/syscalls (#2754)
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.

None yet

3 participants