File: papersize.sh

package info (click to toggle)
r-base 3.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 87,288 kB
  • sloc: ansic: 271,827; fortran: 99,804; makefile: 5,102; yacc: 5,065; sh: 4,968; tcl: 4,562; objc: 753; perl: 655; asm: 258; java: 31; sed: 9
file content (19 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

cp /etc/R/Renviron /tmp/
Sysfile=/etc/papersize
Rfile=/tmp/Renviron

syspaper=`cat $Sysfile`
echo "Papersize in /etc is $syspaper"

rpaper=`grep ^R_PAPERSIZE $Rfile | cut -d"'" -f2`
echo "Papersize in Renviron is $rpaper"

if [ "$syspaper" != "$rpaper" ]; then
    echo "Need to replace $rpaper with $syspaper"

    perl -p -i -e "s|\'$rpaper\'|\'$syspaper\'|"    "$Rfile"
fi

grep PAPERSIZE $Rfile