bash

Cygwin Path Error: Cannot find module 'C:\cygdrive\c\…'

帅比萌擦擦* 提交于 2021-02-11 06:54:37
问题 I am using Cygwin on Windows 7 and it was working as expected until I updated it a couple of days ago. Now when I try to run a makefile for my NodeJs app I get the errors about paths. In error stack I see all the paths have double reference to C drive: C:\cygdrive\c\... Update : Reproduced in Git bash, Windows command line and Cygwin shells. Any ideas how to fix this? 回答1: Make sure the C:\cygdrive\c path is a native, Windows-style symbolic link to just C:\ as that is the expected behavior of

Strange behavior when parsing result from curl + awk

纵然是瞬间 提交于 2021-02-11 06:08:42
问题 Using curl on ubuntu I am trying to fetch the Jenkins version inspired by: https://wiki.jenkins.io/display/JENKINS/Remote+access+API In a bash script I do: VERSION=$(curl -k -i -X GET --insecure --silent --header \"Authorization: Bearer $TOKEN \" $URL | grep -Fi X-Jenkins: | awk '{print $2}') echo "__A__[${VERSION}]__B__" But when I run the script I get: ]__B__2.89.2 So for some reason the prefix: __A__[ gets swallowed and the suffix gets turned into a prefix . I have also tried to trim the

Strange behavior when parsing result from curl + awk

流过昼夜 提交于 2021-02-11 05:59:06
问题 Using curl on ubuntu I am trying to fetch the Jenkins version inspired by: https://wiki.jenkins.io/display/JENKINS/Remote+access+API In a bash script I do: VERSION=$(curl -k -i -X GET --insecure --silent --header \"Authorization: Bearer $TOKEN \" $URL | grep -Fi X-Jenkins: | awk '{print $2}') echo "__A__[${VERSION}]__B__" But when I run the script I get: ]__B__2.89.2 So for some reason the prefix: __A__[ gets swallowed and the suffix gets turned into a prefix . I have also tried to trim the

Strange behavior when parsing result from curl + awk

混江龙づ霸主 提交于 2021-02-11 05:58:41
问题 Using curl on ubuntu I am trying to fetch the Jenkins version inspired by: https://wiki.jenkins.io/display/JENKINS/Remote+access+API In a bash script I do: VERSION=$(curl -k -i -X GET --insecure --silent --header \"Authorization: Bearer $TOKEN \" $URL | grep -Fi X-Jenkins: | awk '{print $2}') echo "__A__[${VERSION}]__B__" But when I run the script I get: ]__B__2.89.2 So for some reason the prefix: __A__[ gets swallowed and the suffix gets turned into a prefix . I have also tried to trim the

Strange behavior when parsing result from curl + awk

痴心易碎 提交于 2021-02-11 05:58:16
问题 Using curl on ubuntu I am trying to fetch the Jenkins version inspired by: https://wiki.jenkins.io/display/JENKINS/Remote+access+API In a bash script I do: VERSION=$(curl -k -i -X GET --insecure --silent --header \"Authorization: Bearer $TOKEN \" $URL | grep -Fi X-Jenkins: | awk '{print $2}') echo "__A__[${VERSION}]__B__" But when I run the script I get: ]__B__2.89.2 So for some reason the prefix: __A__[ gets swallowed and the suffix gets turned into a prefix . I have also tried to trim the

Run aspell on manpage

这一生的挚爱 提交于 2021-02-11 04:54:36
问题 I want use Aspell on man page but i have problem with word splitting. I use man man | col -bx | aspell (...) but "man man | col -bx " return text with spitted words i.e: "man formats and displays the on-line man- ual pages. If you specify section, man on- ly looks in that section of the manual." So Aspell return this words as wrong. Any ideas how switch it off? 回答1: You want to format the man pages without hyphenation. This should do it: groff -mtty-char -Tutf8 -man -rHY=0 /usr/share/man/man1

Bash: select statement doesn't break

旧巷老猫 提交于 2021-02-11 04:53:38
问题 Here's a function containing a select statement that doesn't break unless you choose 'quit': function func_set_branch () { local _file=$1 local _expr=$2 local _bdate=$3 local _edate=$4 local _mid=$(awk -F'\t' -v ref="${_expr}" 'BEGIN {IGNORECASE = 1} match($0, ref) {print $5}' "$CONF") if (( $(grep -c . <<<"${_mid}") > 1 )); then mapfile -t arr <<< "${_mid}" PS3="Please choose an option " select option in "${arr[0]}" "${arr[1]}" quit do case $option in 1) _mid="${arr[0]}"; break 2;; 2) _mid="

Run aspell on manpage

五迷三道 提交于 2021-02-11 04:53:05
问题 I want use Aspell on man page but i have problem with word splitting. I use man man | col -bx | aspell (...) but "man man | col -bx " return text with spitted words i.e: "man formats and displays the on-line man- ual pages. If you specify section, man on- ly looks in that section of the manual." So Aspell return this words as wrong. Any ideas how switch it off? 回答1: You want to format the man pages without hyphenation. This should do it: groff -mtty-char -Tutf8 -man -rHY=0 /usr/share/man/man1

Run aspell on manpage

南楼画角 提交于 2021-02-11 04:52:33
问题 I want use Aspell on man page but i have problem with word splitting. I use man man | col -bx | aspell (...) but "man man | col -bx " return text with spitted words i.e: "man formats and displays the on-line man- ual pages. If you specify section, man on- ly looks in that section of the manual." So Aspell return this words as wrong. Any ideas how switch it off? 回答1: You want to format the man pages without hyphenation. This should do it: groff -mtty-char -Tutf8 -man -rHY=0 /usr/share/man/man1

Bash: select statement doesn't break

北慕城南 提交于 2021-02-11 04:51:55
问题 Here's a function containing a select statement that doesn't break unless you choose 'quit': function func_set_branch () { local _file=$1 local _expr=$2 local _bdate=$3 local _edate=$4 local _mid=$(awk -F'\t' -v ref="${_expr}" 'BEGIN {IGNORECASE = 1} match($0, ref) {print $5}' "$CONF") if (( $(grep -c . <<<"${_mid}") > 1 )); then mapfile -t arr <<< "${_mid}" PS3="Please choose an option " select option in "${arr[0]}" "${arr[1]}" quit do case $option in 1) _mid="${arr[0]}"; break 2;; 2) _mid="