Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # CONKY Task Manager
- width=55
- shortwidth=$(( $width - 3 ))
- # Set the field seperator to a newline
- IFS="
- "
- # Loop through the file
- linenum=0
- for line in `cat $1`;do
- linenum=$(( $linenum + 1 ))
- # echo $linenum
- if [ $linenum -gt 2 ] ; then
- count=`echo $line |wc -c`
- # echo $count
- if [ $count -gt $width ]; then
- temp=${line:0:$shortwidth}
- echo $temp...
- elif [ $count -lt $width ]; then
- echo $line
- fi
- else
- temp=${line:0:$width}
- echo $temp
- fi
- done
Add Comment
Please, Sign In to add comment