What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2022-01-23 09:50:47
iodbc doesn't work on macos high sierra
#!/bin/bash # https://github.com/openlink/iODBC/issues/29 # https://bugs.mysql.com/bug.php?id=89931 base_src_dir="/usr/local" mysql_odbc_name=$(ls "$base_src_dir" | grep -m 1 "mysql-connector-odbc") odbc_dir="/Library/... Add solution -
Shell/Bash 2021-11-17 12:09:24
grep first match
# Basic syntax: grep -m 1 "pattern" input_file.txt # Where -m is the maximum number of matching lines to return, i.e. stop # reading the file after m matches # Note, this is more efficient than piping to head because there you # always read the ... Add solution -
Shell/Bash 2021-09-09 05:47:01
fslinfo
#!/bin/sh # Use fslinfo to extract image dimensions. See fslhd for extraction of more info. # find only the first matching line (-m 1) , print arg2: # this will get the # of voxels in dimension 1 (usually x). dim1=$(fslinfo img | grep -m 1 dim1 | awk ... Add solution -
Shell/Bash 2021-08-30 00:05:02
bash grep only return first match
# Basic syntax: grep -m 1 "pattern" input_file.txt # Where -m is the maximum number of matching lines to return, i.e. stop # reading the file after m matches # Note, this is more efficient than piping to head because there you # always read the ... Add solution -
Shell/Bash 2021-08-29 06:30:01
bash return only first line that contains match for each line in a file
# Basic syntax while IFS= read -r LINE; do grep -m number_matches "$LINE" target_file >> output_file done < reference_file # Where: # - the reference_file is the file of lines you want to search for # - the target_file is the file ... Add solution
Best helpers
Ranking is empty