質問編集履歴

2

で3

2018/02/01 15:47

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -123,3 +123,63 @@
123
123
 
124
124
 
125
125
  みたいなイメージです。
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+ 追記::
136
+
137
+
138
+
139
+
140
+
141
+ ```ここに言語を入力
142
+
143
+ [mg1986jp@sv5015 ~]$ cat test.sh
144
+
145
+ #!/bin/bash
146
+
147
+ function sample() {
148
+
149
+ case "$1" in
150
+
151
+ test|staging|produciton)
152
+
153
+ sed "s/production/$1/" .htsccess.model >.htsccess
154
+
155
+ ;;
156
+
157
+ *)
158
+
159
+ echo B0z?t$,$*$+$7$$
160
+
161
+ exit 2
162
+
163
+ ;;
164
+
165
+ esac
166
+
167
+ }
168
+
169
+
170
+
171
+ $(sample "staging")
172
+
173
+ [mg1986jp@sv5015 ~]$ ./test.sh
174
+
175
+ ./test.sh: 行 10: 予期しないトークン `(' 周辺に構文エラーがあります
176
+
177
+ ./test.sh: 行 10: ` echo B0z?t$,$*$+$7$$'
178
+
179
+ [mg1986jp@sv5015 ~]$
180
+
181
+ ```
182
+
183
+
184
+
185
+ うーん、使い方がおかしいのでしょうか、、、、

1

でd

2018/02/01 15:47

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -99,3 +99,27 @@
99
99
 
100
100
 
101
101
  と、やりたい処理はこうですがこれって実現できるものなのでしょうか?
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ ファイルがメソッドだとするなら
110
+
111
+
112
+
113
+ ```ここに言語を入力
114
+
115
+ echo .htsccess.model test > public_html/test/.htaccess
116
+
117
+ echo .htsccess.model staging > public_html/staging/.htaccess
118
+
119
+ echo .htsccess.model production > public_html/.htaccess
120
+
121
+ ```
122
+
123
+
124
+
125
+ みたいなイメージです。