2014/6/11 -[ x$1 = x ] is also true if $1 is for instance " -o x" . Try sh -xc '[ x$1 = x ] && echo yes' sh ' -o x' . [ x$1 = x ] is wrong and doesn't make ...

2021/10/22 -この場合の式で "x$1" のように x といれている(何の文字列でもいい)のは、例えば $1 が空文字列だった場合にエラーになるから。先人の工夫である。

2017/10/18 -Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left ...

2023/9/12 -It's the same command whichever name you invoke it by, but it does look at which name you used and make one small change based on it: [ requires ...

2023/7/20 -Bashでスクリプトを書く場合のポイントをまとめたBashなどで書くシェル ... ほとんどのLinuxの sh は bash へのリンクと ... x$1" = "x-h" ]; then. と ...

2015/4/27 -I have found similar syntax in other old shell scripts... What is the purpose of this? I guess there is an old habit to use || rather than && to ...

2021/4/12 -... x$1" = "x-l" -o 1 -eq 1 ] (true). This ... sh was the legacy Bourne shell as late as Solaris 10 in 2009. ... Linux-related things, LinuxTags history ...

2019/1/6 -The command chmod is used to. change file mode bits. The format of a symbolic mode is [ugoa...][[-+=][perms...]...], where perms is either ...

すべての UNIX コマンドは終了する際に呼び出し元のプロセス ... そのためにシェル変数 $? が用意されている. この ... x "$1" \) ]; then. とすると,$1 が NULL でなく ...

A.最近何故か cal.sh に関する質問が多いですね。 多分、ある学校で課題として出題されてるのでしょうね。 >x,y,zの値に不適切な入力値がある場合や、引数の数が2つより少ない場合 &...

解決済み-回答:1件-2010/1/28

A.問題文では「引数をインクリメントする」って書かれているのに、なんで、 >③for文((i=$1 ; i%9 ; i++))の部分を((i=$1 ; i%9 ; i++))の形で使用せず、他の構文や

解決済み-回答:1件-2022/11/21

A.Cygwinでは改行コードがCR+LFなのですがLinuxではLFのみです。 CR=^Mなのでそれを取り去ればいいわけですね。 取り去る方法としては nkf -Lu bc_last.dat >

解決済み-回答:1件-2011/8/8