Created
September 14, 2018 07:03
-
-
Save mkanenobu/b0bf2d2dc8d8303b84531f1547aad062 to your computer and use it in GitHub Desktop.
.bashrcに書いてあるエイリアスをxonshの構文に変換するスクリプト ref: https://qiita.com/mkanenobu/items/7ba1c238ad4fb20a47f8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read line; do | |
if [[ $line =~ ^alias ]]; then | |
echo -n aliases\[\""$(echo "$line" | cut -d'=' -f 1 | sed -e "s/alias //g" )"\"\] = | |
echo " $(echo "$line" | cut -d'=' -f 2-)" | |
fi | |
done < ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment