Ayer, Paul W wrote:
#!/bin/sh
#
#
   modprobe vmcp
   vmcp DEF VFB-512 AS 9999 BLK 1050000
sleep 10
   echo 1 > /sys/bus/ccw/drivers/dasd-fba/0.0.9999/online
sleep 10
   cat /proc/dasd/devices | grep 9999 | cut -c35-40 > /tmp/device
   vswap=$(cat /tmp/device)
   mkswap /dev/$vswap
   swapon -p50 /dev/$vswap

================================
Hello Paul,
rather than using 2 cat's, 1 grep, 1 cut, and a temporary file over 2
statements:

  cat /proc/dasd/devices | grep 9999 | cut -c35-40 > /tmp/device
  vswap=$(cat /tmp/device)


consider something like this simple awk in 1 statement

   vmswap=$(awk '/^0.0.9999/{print $8}' /proc/dasd/devices)

mark

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to