WSL bash(ubuntu bash )で、次のコマンドをaliasや関数に登録したいのですが、どうもうまくできません。どうしたらよいでしょうか?
powershell.exe . $(python -c "import os.path; print os.path.relpath('/mnt/c/_videos/agd/$(ls -t1 /mnt/c/_videos/agd/ | head -n 1)', '$(echo $PWD)')")
試したこと
alias
alias agd='powershell.exe . $(python -c "import os.path; print os.path.relpath('/mnt/c/_videos/agd/$(ls -t1 /mnt/c/_videos/agd/ | head -n 1)', '$(echo $PWD)')")'
エラー
$ agd File "<string>", line 1 import os.path; print os.path.relpath(/mnt/c/_videos/agd/video_20180824_104256.mp4, /mnt/c/_images) ^ SyntaxError: invalid syntax At line:1 char:1 + . + ~ Missing expression after '.' in pipeline element. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingExpression
関数
agd(){ powershell.exe . $(python -c "import os.path; print os.path.relpath('/mnt/c/_videos/agd/$(ls -t1 /mnt/c/_videos/agd/ | head -n 1)', '$(echo $PWD)')") }
エラー
bash: 予期しないトークン `}' 周辺に構文エラーがあります
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/25 01:19
2018/08/25 02:25