3 # Convert Csh aliases to Bash aliases. Adapted from a similar program
6 # This is a quick script to convert csh aliases to Bash aliases/functions.
7 # Pipe the output of csh's alias command through this; it will generate
8 # a series of alias/function definitions on stdout, suitable for
11 # This is not perfect, but it gets most common aliases; it should manage to
12 # cut down a lot of the busy work.
14 sed -e 's/ (\(.*\))/ \1/' >/tmp/cz$$.1
15 grep ! /tmp/cz$$.1 >/tmp/cz$$.2
16 grep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
17 sed -e "s/'/'"\\\\"''"/g -e 's/^\([^ ]*\) \(.*\)$/alias \1='"'\2'/" \
19 sed -e 's/![:#]*/$/g' -e 's/^\([^ ]*\) \(.*\)$/\1 () { \2 }/' /tmp/cz$$.2