Berkeley CSUA MOTD:Entry 16724
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

1999/10/17 [Computer/SW/Unix] UID:16724 Activity:nil
10/15   nsplit <file> <n>
        #!/bin/csh -f
        if ($#argv != 2) then
                echo "Usage: `basename $0` <file> <number>"
                exit 1
        else
                set SPLITFILE = $1
                set FILECOUNT = $2
        endif
        if !(-e ${SPLITFILE} && ${FILECOUNT} > 0) then
                echo "Bad arguments."
                exit 2
        endif
        set linetotal = `cat ${SPLITFILE} | wc -l`
        set linecount = `expr ${linetotal} / ${FILECOUNT} + 1`
        split -$linecount $splitfile
        \_ Why is this in the motd?