cron 80 characters limit

Thread Tools Search this Thread
Operating Systems HP-UX cron 80 characters limit
# 1  
Old 10-27-2009
cron 80 characters limit

Hello everyone.
I am trying to set up a monitor based on a "top" command statistic as follows:
top -bc -n1 > output.txt

I've put this command into a small script which is called by a cron... but there is something strange happening: the cron is limiting the output to output.txt to 80 characters.
If I call this script from a standart command line, evenrything is fine, no wrapping is occuring.
I'm using a HP-UX shell.
I red somewhere on internet that it could be a case of wrong editor - but that's not my case.

Could please advice?
Thank you.

# 2  
Old 10-27-2009
For a start
ra:/home/vbe $ top -bc -n1 > output.txt 
top: illegal option -- b
Usage:  top [-u] [-q] [-dx] [-sx] [-n number] [-f filename]
ra:/home/vbe $ uname -r

What do you call an HP-UX shell?

Did you look at the man pages of top?
(there is a great option: -f filename... etc...)

---------- Post updated at 17:53 ---------- Previous update was at 17:49 ----------

ran:/home/vbe $  top -bc -n1 > output.txt
top: illegal option -- b
Usage:  top [-u] [-q] [-P] [-dx] [-sx] [-p pset_id] [-n number] [-f filename]
ran:/home/vbe $ uname -r

Please specify which version of OS you are using for it does help us looking at your issue ( in the present case I have no 11.23 or above to chek at the moment...) the code you gave does not work on 11.00 or 11.11...

Last edited by vbe; 10-27-2009 at 02:58 PM.. Reason: addendum
# 3  
Old 10-27-2009
To endorse "vbe" the command options stated aren't valid with the "normal" version of "top" on HP-UX 11.11. The "-n" switch for example is for items per page not iterations.
# 4  
Old 10-28-2009
Hello guys, sorry, wrong postSmilie The machine is a Linux.
I hope I can find a solution on my own on internet.
Thank you...

---------- Post updated at 11:18 AM ---------- Previous update was at 07:22 AM ----------

Hi, just to inform you: the solution was adding EXPORT COLUMNS=250 to the script.
I found the solution under another HP-UX formu, so I don't think it was a case of environment, rather something else.
Have a nice day!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

2. Shell Programming and Scripting

Limit the number of characters in bash output

Hi, I need some help with this: I'm making a script which does a couple of things with image files. The script is supposed to echo the number of each image it is processing like this: Processing image1.jpgThe problem is with images with very long filenames, so I want to know how to limit the... (5 Replies)
Discussion started by: Shadow_Reaper
5 Replies

3. UNIX for Dummies Questions & Answers

Limit reoccurrance of characters in lines

Hey guys and gals, Working on a script to limit the reoccurrance of characters in a line. sed "/\(.\).*\1/d" -i file.txt sed "/\(.\).*\1.*\1/d" -i file.txt sed "/\(.\).*\1.*\1.*1/d" -i file.txt .. To limit character reoccurance with 1x, 2x, 3x etc. However I would like to be able to... (2 Replies)
Discussion started by: TAPE
2 Replies

4. Solaris

Limit: stacksize: Can't remove limit

Hi all, I'm using to Solaris machine. When I run a simple script this messenger come out:"limit: stacksize: Can't remove limit". Any one know the way to resolve this problem without reboot the machine? Thanks in advance. (3 Replies)
Discussion started by: Diabolist9
3 Replies

5. UNIX for Dummies Questions & Answers

Limit the number of characters in a bash output

I have a script that outputs the weather on two lines. If possibly I would like to set a character limit on them Currently it outputs something like but I would like to limit the lines so appends an ellipsis if nescessary: This is the script #! /bin/bash curl -s --connect-timeout... (2 Replies)
Discussion started by: Light_
2 Replies

6. Shell Programming and Scripting

Limit on Number of characters in a line - Vi editor

In the vi editor, there seems to be some limit on the number of characters could be allowed in single line. I tried a line with characters up to 1880. It worked. But when i tried with something of 5000 characters, it doesnt work. Any suggestions. Thanks in advance! (2 Replies)
Discussion started by: nram_krishna@ya
2 Replies

7. UNIX for Advanced & Expert Users

Limit on Number of Cron Jobs Running on one Account

Hello, I have some 150 Cron Jobs running under my UNIX account. I want to add some more jobs. Is there a limit to the number of cron jobs that can be run on an account? Thank you. Pramodini (8 Replies)
Discussion started by: Pramodini Rode
8 Replies

8. AIX

Is the Length of User ID for AIX Limit to 8 Characters?

Hi, I'm using AIX version 5.3 currently. I'm trying to create a user id, e.g. andyleong, which the system prompted the length is too long. 1. I would like to know is that the length of user id is limited to maximum 8 characters for AIX. 2. Is it apply to all versions of AIX? If no... (2 Replies)
Discussion started by: meihua_t
2 Replies

9. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

10. Shell Programming and Scripting

Limit of no of characters PER LINE in a unix file

Hi , Whats the limit of characters PER LINE in a unix file , allowed for editing..sort , cut , sed , awk etc (5 Replies)
Discussion started by: mohapatra
5 Replies
Login or Register to Ask a Question