Jump to content
Compatible Support Forums

chewmanfoo

Members
  • Content count

    8
  • Joined

  • Last visited

    Never

Posts posted by chewmanfoo


  1. Guys,

     

    I'm writing a series of scripts for deploying in our support center. One that I'm working on involves /proc/kcore, the physical RAM of a linux system. I'm trying to display the amount of physical RAM in a system by returning the size of this file divided by 1024.

     

    I'd like it to eventually say: PHYSICAL RAM: 512MB.

     

    Here's what I've tried, and the results:

     

    Code:
    $ echo "System RAM";ls -l /proc/kcoreSystem RAM-r--------    1 root     root     958595072 Feb 14 13:13 /proc/kcore$ $ ls -l /proc/kcore | 'expr $5/1024'/bin/ksh: expr $5/1024: not found$ ls -l /proc/kcore | echo $5$ ls -l /proc/kcore | echo $1$ ls -l /proc/kcore > echo $5/bin/ksh: cannot create echo: No such file or directory$ ls -l /proc/kcore | awk "print int($5/1024)"awk: cmd. line:1: print int(/1024)awk: cmd. line:1: ^ parse errorawk: cmd. line:1: print int(/1024)awk: cmd. line:1:            ^ unterminated regexpawk: cmd. line:2: print int(/1024)awk: cmd. line:2:                 ^ unexpected newline$ ls -l /proc/kcore | awk {print int($5/1024)}/bin/ksh: syntax error: `(' unexpected$ ls -l /proc/kcore | awk `BEGIN {print int($5/1024)}'> > ^C$ $ ls -l /proc/kcore | awk `{print int($5/1024)}`/bin/ksh: syntax error: `(' unexpected$ ls -l /proc/kcore | awk -F `{print int($5/1024)}'> > ^C$ ls -l /proc/kcore | awk -F `{print int($5/1024)}'> ^C$ awk '{ print int($5/1024) }` < ls -l /proc/kcore> ^C$ ls -l /proc/kcore > temp; awk '{ print int($5/1024) }` temp> ^C

     

    As you can see, I'm stuck on awk. Can anyone shed some light on this?

     

    I basically want to take the 5th field of an ls and display the result of that field divided by 1024.

     

    Anyone?

     

    TIA!

    chewy


  2. Whoa, I've never seen this before in such a modern os:

     

    [root@localhost opt]# mount /mnt/winNTFSmed

    mount: fs type ntfs not supported by kernel

     

    here's fstab:

     

    LABEL=/ / ext3 defaults 1 1

    LABEL=/boot /boot ext3 defaults 1 2

    none /dev/pts devpts gid=5,mode=620 0 0

    none /proc proc defaults 0 0

    none /dev/shm tmpfs defaults 0 0

    /dev/hda9 swap swap defaults 0 0

    /dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0

    /dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto,owner,kudzu,ro 0 0

    /dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

    /dev/hda1 /mnt/winNTFS ntfs defaults 0 0

    /dev/hda2 /mnt/winNTFS2 ntfs defaults 0 0

    /dev/hda3 /mnt/winNTFS3 ntfs defaults 0 0

    /dev/hdb1 /mnt/winNTFSmed ntfs defaults 0 0

     

    am I doing something wrong? All my windows partitions are NTFS!!?!!

     

    Help!

    chewy

     

    Oh, and TIA!

×