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
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
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 Search options user 11417

Questions about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.).

2
votes
Assuming the *frames directories are all in the same directory, you can do something like cd to/the/parent/of/the/frames/dirs mkdir all-my-raws cp *.frames/*.raw all-my-raws/ To avoid duplication o …
answered Mar 30 '15 by nohillside
1
vote
To avoid surprises from filenames containing spaces or worse it might be worthwhile to run everything directly from find: find /PATH/TO/SOURCE -name '*.mp4' \ -exec sh -c '[ -e "$1.t" ] …
answered Jan 1 '18 by nohillside
0
votes
So you want to run the functions only when the corresponding variable is set to TRUE? I would do something like [[ "$data_error_check_run" == TRUE ]] && data_error_check [[ "$check_ctl_dat_exist …
answered Mar 26 '18 by nohillside
8
votes
The lazy way is just to run if [[ $mac_address == ??:??:??:??:??:?? ]]; then echo Heureka; fi but this doesn't check whether it's a hex string. So if this is important if [[ $mac_address =~ ^[0-9a …
answered Jan 8 '18 by nohillside
4
votes
You can use ${var:offset:length} to extract part of a variable and compare the result of this as needed. If you omit the length part the remainder of the string starting from offset will be taken. i …
answered Jan 1 '18 by nohillside
1
vote
You need to quote your variables when using them, otherwise paths with spaces and other special characters will not work: read -e -p "Enter the full path to the Home Directory :" userpath var=$(sudo …
answered Apr 2 by nohillside
5
votes
Not really sure what you want to do here, but with foo="postgres 3625 1 0 Jan31 ? 00:00:35 /opt/rh/rh-postgresql95/root/usr/bin/postgres -D /var/opt/rh/rh-postgresql95/lib/pgsql/data" you can use s …
answered Feb 22 '18 by nohillside
2
votes
Keep in mind that shell scripts are just text files which get interpreted by, well, an interpreter, in your case bash. So any process executing a bash script is basically an instance of bash reading a …
answered Jan 3 '18 by nohillside
1
vote
You can't set variables of the parent shell in a shell script you call from it. Either set the variables as usual in the script but source it: . my_command have the script print the variables to be …
answered Jan 3 '18 by nohillside
2
votes
Why iterate? grep takes several file arguments at once, so grep PATTERN abc.* should work. In case the files are not all in the same directory, using find is an option: find /tmp/files -name 'abc …
answered Jan 3 '18 by nohillside
1
vote
With just the script from the question I probably would do something like (ignoring other potential improvements for now) have_results=0 while [[ $have_results -eq 0 ]]; do read -p "Please inp …
answered Oct 22 '18 by nohillside
0
votes
Using a for loop might not be the best option here, better use find: cd /PATH/TO/image_script/.. find image_script -type d If you need the absolute path you can use find /PATH/TO/image_script -typ …
answered Jan 4 by nohillside
3
votes
sftp doesn't fork a shell so you can't use your usual commands there. Assuming you also can login through ssh you can use ssh Dbprd@101.102.130.23 'ls /files/base/incomming/*.txt' | wc -l or ssh D …
answered Oct 27 '18 by nohillside
3
votes
You can pass data to awk with -v var=value, any number of -v options may be present: awk -v foo=FOO 'END {print foo}' </dev/null awk -v foo=FOO -v bar=BAR 'END {print foo, bar}' </dev/null As usual …
answered Jan 26 '18 by nohillside
2
votes
From man ls: In addition, for each directory whose contents are displayed, the total number of 512-byte blocks used by the files in the directory is displayed on a line by itself, immediately befo …
answered Jul 20 '18 by nohillside

15 30 50 per page