Show pages on a script's big output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Show pages on a script's big output
# 1  
Old 07-16-2010
Show pages on a script's big output

Hi again:

I have this code which gives an large output(several screens), and I want to display on screen at a time (like more does)....how can I do this?

Code:
echo
echo "Los roles en el sistema son:"
echo
lsrole -a dfltmsg ALL|sed 's/dfltmsg=/Descripcion=/'


thanks
Israel.

Last edited by Scott; 07-16-2010 at 06:53 AM..
# 2  
Old 07-16-2010
more, less, pg
or save the output to a file, and watch it with vi


depending on your terminal emulator, you could change the history cache to unlimited, and watch your outputfile with tail -f, then scroll up and down in your terminal
# 3  
Old 07-16-2010
Quote:
Code:
lsrole -a dfltmsg ALL|sed 's/dfltmsg=/Descripcion=/'

Code:
lsrole -a dfltmsg ALL|sed 's/dfltmsg=/Descripcion=/' | more

Code:
lsrole -a dfltmsg ALL|sed 's/dfltmsg=/Descripcion=/' | less

# 4  
Old 07-16-2010
OK, and what if I have a loop, like this

Code:
while read line
   do
        set $line
        username=$1
        logintime=`echo $2 | awk -F= ' { print $2 } '`
        if [[ $logintime -lt $refpoint ]]; then
                lsuser -a time_last_login gecos $username  |awk '{print $1,$2,$3,$4}'|sed -e 's/gecos=/  Nombre: /' -e 's/time_last_login=/  Ultimo_Login=/'| while read ACCOUNT LOGIN NUM USER; do echo $ACCOUNT      ${LOGIN%%[0-9]*}     $(getdate ${LOGIN##*=})     $NUM    $USER; done

        fi
   done

echo

Where do I should insert 'more' command?

Moderator's Comments:
Mod Comment For listings, please use [CODE], not [QUOTE] tags.

Last edited by Scott; 07-16-2010 at 06:52 AM..
# 5  
Old 07-16-2010
Code:
while read line
do
    set $line
    username=$1
    logintime=`echo $2 | awk -F= ' { print $2 } '`
    if [[ $logintime -lt $refpoint ]]
    then
        (
        lsuser -a time_last_login gecos $username |awk '{print $1,$2,$3,$4}'| \
        sed -e 's/gecos=/ Nombre: /' -e 's/time_last_login=/ Ultimo_Login=/'| \
        while read ACCOUNT LOGIN NUM USER
        do
            echo $ACCOUNT ${LOGIN%%[0-9]*} $(getdate ${LOGIN##*=}) $NUM $USER
        done
        ) 2>&1 | more
    fi
done

echo


Note: $refpoint is not set anywhere.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Solaris 11 man pages won't show on CLI

Hello guys, I am a newbie. Just freshly installed Solaris 11. When I try to type for example root@t1000:~# man zpool It says bash: man: command not found. It used to show manual pages before installation. Any help is appreciated. Thanks. (5 Replies)
Discussion started by: nazimbilir
5 Replies

2. Shell Programming and Scripting

Script that will show output starting from 24-hours earlier to present

Hi Guys, Good day! I hope you could help me on this, I have a file that conatins output upon executing cat /var/log/messages, then what I want is to get the logs that has been generated only starting from 24-hours earlier at the time of actual execution of the script. Is this possible? Best... (9 Replies)
Discussion started by: rymnd_12345
9 Replies

3. Shell Programming and Scripting

Bash script show Kill system output

Hi we are calling kill -9 $pid command from bash script it gives below output, but we need to hide the output. i tried /dev/null but ni luck. is there any alternate way to schive this. ../kill_scr.sh: line 42: 1891 Killed /tmp/anr_rest_mul_wc.sh Soalris 10. ... (2 Replies)
Discussion started by: sachinbutala
2 Replies

4. Shell Programming and Scripting

Two files one file is dependent and it does not show an output

xxxxx (2 Replies)
Discussion started by: vinayrao
2 Replies

5. UNIX for Advanced & Expert Users

prtdiag -v show no output

Dear All....Help required prtdiag -v command shows no output on my V440 server. Following is the details: root@sdp16b>prtdiag -v root@sdp16b> root@sdp16b>uname -a SunOS sdp16b 5.9 Generic_122300-31 sun4u sparc SUNW,Sun-Fire-V440 root@sdp16b>echo $path /usr/sbin /usr/bin /usr/sbin... (6 Replies)
Discussion started by: Junaid
6 Replies

6. Shell Programming and Scripting

Compact 3-D output from a big input like:

Hi Experts!!!! Tried a lot but in vein,no success, please help to achieve this LOGIC behind is first field is reffrance row field, the second field shoud be made titles of coulmn and the the third field is made as matrix value. And if they dont match the matrix value should be 0. (Unix (Shell,... (1 Reply)
Discussion started by: ashis.tewari
1 Replies

7. Shell Programming and Scripting

Help required to parse Oracle imp show=y output to DDL Commands

Hi, I generated an Oracle schema DDL script file using the show=y option of the Oracle import utility but the file that it generates needs a little more formating before we can run this as simple DDL comands to generate the schema at Target using the script file.Here is the simplified output of... (1 Reply)
Discussion started by: rajan_san
1 Replies

8. Shell Programming and Scripting

echo doesnot show output

hi every one , i m new in unix . i m trying shell scripting . set v = abc echo $v but it does not show any output . please help me (4 Replies)
Discussion started by: samy123
4 Replies
Login or Register to Ask a Question