https://github.com/jonmagic/bash-experiment-20151006
https://github.com/jonmagic/bash-experiment-20151006
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jonmagic/bash-experiment-20151006
- Owner: jonmagic
- Created: 2015-10-06T22:20:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-06T22:27:00.000Z (over 10 years ago)
- Last Synced: 2025-01-31T13:43:47.696Z (about 1 year ago)
- Language: Shell
- Size: 121 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bash experiment 20151005
Loop through results from find command and extract a part of each result and then test if that path exists.
```bash
$ git clone https://github.com/jonmagic/bash-experiment-20151006
...
$ cd bash-experiment-20151006
```
```bash
bash-experiment-20151006 $ tree
.
├── README.md
├── cache
│ └── data
│ ├── a
│ │ ├── 1
│ │ │ └── cache
│ │ ├── 2
│ │ │ └── cache
│ │ ├── 3
│ │ │ └── cache
│ │ └── cache
│ ├── b
│ │ └── 4
│ │ └── cache
│ └── c
│ ├── 7
│ └── 8
│ └── cache
├── data
│ ├── a
│ │ ├── 1
│ │ └── 2
│ ├── b
│ │ ├── 4
│ │ ├── 5
│ │ └── 6
│ └── c
│ ├── 7
│ └── 9
└── run
28 directories, 2 files
```
```bash
bash-experiment-20151006 $ ./run
cache dir: ./cache/data/a/1/cache
possible associated path: ./data/a/1
found: ./data/a/1
cache dir: ./cache/data/a/2/cache
possible associated path: ./data/a/2
found: ./data/a/2
cache dir: ./cache/data/a/3/cache
possible associated path: ./data/a/3
not found: ./data/a/3
cache dir: ./cache/data/b/4/cache
possible associated path: ./data/b/4
found: ./data/b/4
cache dir: ./cache/data/c/8/cache
possible associated path: ./data/c/8
not found: ./data/c/8
```