Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if (( $# < 1 )) ; then
- echo -e "ERROR: Missing argument. Usage:\n$0 filename[.c|.cpp]" >& 2
- fi
- bname=`echo $1 | sed 's/\(.*\)\\..*/\1/g'`
- exts=("" ".cpp" ".c")
- for ext in ${exts[@]}; do
- srcname="${bname}${ext}"
- if [ -f "$srcname" ]; then
- vim -c "vsplit $srcname" "$bname.h"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement