質問編集履歴

2

\[\]の前後にスペースを追加しました

2017/03/18 04:44

投稿

McKee
McKee

スコア16

test CHANGED
File without changes
test CHANGED
@@ -24,9 +24,9 @@
24
24
 
25
25
 
26
26
 
27
- if [ -e /Users/hoge/radio/file/tmp/${fartist}]; then
27
+ if [ -e /Users/hoge/radio/file/tmp/${fartist} ]; then
28
28
 
29
- if [ -e /Users/hoge/radio/file/tmp/${fartist}/${falbum}]; then
29
+ if [ -e /Users/hoge/radio/file/tmp/${fartist}/${falbum} ]; then
30
30
 
31
31
  mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
32
32
 
@@ -58,10 +58,6 @@
58
58
 
59
59
  ```
60
60
 
61
- ./Foldering.sh
62
-
63
- ./Foldering.sh: line 11: [: missing `]'
64
-
65
61
  mkdir: /Users/hoge/radio/file/tmp/hoge: No such file or directory
66
62
 
67
63
  mv: rename ./19900101@hoge_hoge.flv to /Users/hoge/radio/file/tmp/hoge/hoge/: No such file or directory

1

コードの部分を灰色にして見やすくしました

2017/03/18 04:44

投稿

McKee
McKee

スコア16

test CHANGED
File without changes
test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  #コード
10
10
 
11
- /usr/bin/bash
11
+ ```/usr/bin/bash
12
12
 
13
13
 
14
14
 
@@ -26,33 +26,37 @@
26
26
 
27
27
  if [ -e /Users/hoge/radio/file/tmp/${fartist}]; then
28
28
 
29
- ---if [ -e /Users/hoge/radio/file/tmp/${fartist}/${falbum}]; then
29
+ if [ -e /Users/hoge/radio/file/tmp/${fartist}/${falbum}]; then
30
30
 
31
- ------mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
31
+ mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
32
32
 
33
- ---else
33
+ else
34
34
 
35
- ------mkdir /Users/hoge/radio/file/tmp/${fartist}
35
+ mkdir /Users/hoge/radio/file/tmp/${fartist}
36
36
 
37
- ------mkdir /Users/hoge/radio/file/tmp/${fartist}/${falbum}
37
+ mkdir /Users/hoge/radio/file/tmp/${fartist}/${falbum}
38
38
 
39
- ------mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
39
+ mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
40
40
 
41
- ---fi
41
+ fi
42
42
 
43
43
  else
44
44
 
45
- ---mkdir /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
45
+ mkdir /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
46
46
 
47
- ---mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
47
+ mv $f /Users/hoge/radio/file/tmp/${fartist}/${falbum}/
48
48
 
49
49
  fi
50
50
 
51
51
  done
52
52
 
53
+ ```
54
+
53
55
 
54
56
 
55
57
  #エラーメッセージ
58
+
59
+ ```
56
60
 
57
61
  ./Foldering.sh
58
62
 
@@ -61,3 +65,5 @@
61
65
  mkdir: /Users/hoge/radio/file/tmp/hoge: No such file or directory
62
66
 
63
67
  mv: rename ./19900101@hoge_hoge.flv to /Users/hoge/radio/file/tmp/hoge/hoge/: No such file or directory
68
+
69
+ ```