Search Results
| Search type | Search syntax |
|---|---|
| Tags | [tag] |
| Exact | "words here" |
| Author | user:1234 user:me (yours) |
| Score | score:3 (3+) score:0 (none) |
| Answers | answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
| Views | views:250 |
| Code | code:"if (foo != bar)" |
| Sections | title:apples body:"apples oranges" |
| URL | url:"*.example.com" |
| Saves | in:saves |
| Status | closed:yes duplicate:no migrated:no wiki:no |
| Types | is:question is:answer |
| Exclude | -[tag] -apples |
| For more details on advanced search visit our help page | |
Results tagged with shell-script
Search options not deleted user 98945
Questions about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.). Check scripts with https://shellcheck.net before posting.
1 vote
Getting the shellscript to display a chosen file extension
As mentioned already find is usually the correct tool when handling files. It can however be perfectly OK. You can skip this part of printf if you want, only include it as a bonus :P One thing that …
18 votes
Accepted
bashscript to detect right arrow key being pressed
You (likely) read first out of two+ bytes. $keycode in your script would be ESC when arrow key is pressed. Arrow keys can be: \x1b + some value It always evaluates to true because of missing space …
1 vote
Two-words argument in shell script
If you for some reason need/want read you could say: read -r user mm dd time1 time2 date="$mm $dd" Using -r is generally a good idea – even when one think one does not need it. The -r option t …
2 votes
Delete N lines, keep the next N and so on
Another awk variant: awk '(NR-1)%24>11' file.txt > result.txt
2 votes
How to return 0 if a pattern is matched from a file?
Grep exits by default with 0 on match and 1 on no match. As such you could do: grep -q "targed file \$1 is patched sucesfully, enjoy new kernel" foo.log The -q suppress any output. To test say som …