Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: listing contents of pwd eventhough not used ls  (Read 3837 times)

0 Members and 1 Guest are viewing this topic.

Virus Guy

    Topic Starter


    Rookie

    listing contents of pwd eventhough not used ls
    « on: December 22, 2010, 01:37:49 AM »

    Hi Friends, even though i am not using ls command this script lists out the contents of the present working directory
    How to resolve this problem

    Script :

    for tlines in ` grep RES nohup.out | grep SUCC | egrep  'db-tests|dbrgsn-tests' | cut -c14-100 | cut -f1 -d' ' `
       do
          echo "Hi"
       done

    Required data :
    (1)
    linuxx86:110$ grep RES nohup.out
    RESULT: test=subdb/subnet/bcache:lt owners=db-tests PID=24403 slot=0 time=57 dir=/scratch/ddasa/110/hpuxia64/bcachelt.dir status=SUCCEEDED
    RESULT: test=subdb/regres/bkblkf: owners=dbrgsn-tests PID=25933 slot=0 time=62 dir=/scratch/ddasa/110/hpuxia64/bkblkf.dir status=SUCCEEDED
    RESULT: test=subdb/regres/exsw:_asa2 owners=dbrgsn-tests PID=26699 slot=0 time=1208 dir=/scratch/ddasa/110/hpuxia64/exsw_asa2.dir status=SUCCEEDED
    RESULT: test=subdb/subnet/nshut: owners=db-tests PID=9055 slot=0 time=55 dir=/scratch/ddasa/110/hpuxia64/nshut.dir status=SUCCEEDED
    RESULT: test=subdb/regres/pmontst: owners=db-tests PID=9523 slot=0 time=557 dir=/scratch/ddasa/110/hpuxia64/pmontst.dir status=FAILED
    RESULT: test=subdb/regres/vptest: owners=db-tests PID=10492 slot=0 time=15 dir=/scratch/ddasa/110/hpuxia64/vptest.dir status=FAILED
    RESULT: test=subsql92/subjava/constress:_t4ck owners=sqlqa1 PID=10908 slot=0 time=646 dir=/scratch/ddasa/110/hpuxia64/constress_t4ck.dir status=SUCCEEDED
    RESULT: test=subdb/mdbq/cacheupdatemdbqwpool:_tab owners=mdbq-tests PID=12004 slot=0 time=127 dir=/scratch/ddasa/110/hpuxia64/cacheupdatemdbqwpool_tab.dir status=SUCCEEDED
    RESULT: test=subsql92/subjava/dbdata:_t4 owners=sqlqa1 PID=14092 slot=0 time=117 dir=/scratch/ddasa/110/hpuxia64/dbdata_t4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/batchupdate:_t4 owners=sqlqa1 PID=15697 slot=0 time=1334 dir=/scratch/ddasa/110/hpuxia64/batchupdate_t4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/blobtests:_t4 owners=sqlqa1 PID=18121 slot=0 time=184 dir=/scratch/ddasa/110/hpuxia64/blobtests_t4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/preparedstatement:_t4 owners=sqlqa1 PID=18857 slot=0 time=137 dir=/scratch/ddasa/110/hpuxia64/preparedstatement_t4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/tstz:_jdbct4 owners=sqlqa1 PID=19999 slot=0 time=31 dir=/scratch/ddasa/110/hpuxia64/tstz_jdbct4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/indexes:_t4 owners=sqlqa1 PID=20557 slot=0 time=106 dir=/scratch/ddasa/110/hpuxia64/indexes_t4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/convs_t4: owners=sqlqa1 PID=21575 slot=0 time=111 dir=/scratch/ddasa/110/hpuxia64/convs_t4.dir status=FAILED_KNOWN
    RESULT: test=subsql92/subjava/dbsys:_t4 owners=sqlqa1 PID=22613 slot=0 time=80 dir=/scratch/ddasa/110/hpuxia64/dbsys_t4.dir status=FAILED_KNOWN


    (2)
    linuxx86:110$ ls
    total 28
    -rwxrwxrwx 1 jpolu   rdl 15569 Dec 14 08:14 nohup.out
    -rw-rw-r-- 1 jpolu   rdl   557 Dec 14 08:17 result.txt
    -rwxrwxrwx 1 lrathod rdl   496 Dec 16 06:18 alarm
    -rwxrwxrwx 1 lrathod rdl   339 Dec 22 02:37 test

    (3)
    OUTPUT : //After pasting above script

    linuxx86:110$ for tlines in ` grep RES nohup.out | grep SUCC | egrep  'db-tests|dbrgsn-tests' | cut -c14-100 | cut -f1 -d' ' `
    > do
    >
    alarm       nohup.out   result.txt  test   //Listing the contents of pwd eventhough ls command not used
    > echo "Hi"
    > done
    Hi
    Hi
    Hi
    Hi