Sponsored Content
Top Forums Shell Programming and Scripting Script works fine until I | more Post 95452 by Perderabo on Wednesday 11th of January 2006 10:17:32 AM
Old 01-11-2006
The ls program will do stuff like this on most systems. Maybe AIX is an exception. But for me, "ls" and "ls | more" give different results. I am forced to do a "ls -C | more" to see the equivalent of "ls'. What is happening is that the ls program is looking at stdout and checking to see if it's a tty or not. If it is a tty, it defaults to -C. Any program can do that, but to do so is controversial to say the least. All I can suggest is to check the man page for your command and see if there is an option to give you the result you want. Possibly the program is innocent and it's the script that is doing this. To see the syntax, try these commands from a ksh prompt:
{ [ -t 1 ] && echo yes; }
{ [ -t 1 ] && echo yes; } | cat

The first should print "yes" but the second should print nothing. Check your script for stuff like that.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job fails, but works fine from command line

I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is: 55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies

2. Shell Programming and Scripting

"ld.so.1" error using a cron job | works fine otherwise

Hi, A cron job CJ invokes a shell script SC. SC internally invokes multiple perl scripts. One of the perl scripts deals with Accurev (i am using Accurev CLI). The first accurev command encountered is accurev merge -i <<file_name>> (file name has absolute path) When I run the perl script or... (1 Reply)
Discussion started by: singh
1 Replies

3. UNIX for Advanced & Expert Users

mount -t cifs permission denied by mount -t smbfs works fine

I am having trouble mounting with cifs, but mounting the exact same command with smbfs works fine. The share is on another samba server and is set to full public guest access. # mount -t cifs //servername/sharename /mnt/temp -o password="" mount error 13 = Permission denied Refer to the... (3 Replies)
Discussion started by: humbletech99
3 Replies

4. UNIX for Dummies Questions & Answers

$USER is not set in remsh but works fine via ssh login

1) ssh a@b echo $USER it display the correct value as a (even though i have not defined it in .profile) 2) remsh b -l a echo $USER it does not display the value as a (variable is not set any idea why $USER variable is not initialized when i login via remsh or rlogin but shows the... (10 Replies)
Discussion started by: reldb
10 Replies

5. Shell Programming and Scripting

Script works fine but not with crontab

Hello All, This is driving me nuts. Wrote a very simple script (it's in csh so sorry about that). Just something very simple though. Here is the catch. Works great from command line sometimes. Other times it runs no errors or anything but I never receive an email. Never runs from crontab... (6 Replies)
Discussion started by: jacktay
6 Replies

6. Shell Programming and Scripting

Sed script not working properly on Solaris (works fine on AIX)?

Hi, I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system. The ksh script executes the SED and puts the output in HTML in tables. But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is... (7 Replies)
Discussion started by: Faith111
7 Replies

7. Shell Programming and Scripting

Not the correct output, works fine via CLI, not inside the script.

Guys, I need you help please. The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") " Syntax RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "` echo " ==============... (4 Replies)
Discussion started by: Junes
4 Replies

8. UNIX for Dummies Questions & Answers

C-program works fine interactively, but not on the SGE server

Greetings, I have a C-program that is made to implement a hidden Markov model on an input file. The program is very memory intensive. I've installed it on my local server where I have an account and it compiles fine. The way they have the server set up is that you can either work... (1 Reply)
Discussion started by: Twinklefingers
1 Replies

9. Shell Programming and Scripting

sed command not working inside ksh script but works fine outside

Hi, I am a bit confused ,why would a sed command work fine outside of ksh script but not inside. e.g I want to replace all the characters which end with a value and have space at end of it. so my command for it is : sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies

10. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies
zshdb(1)						User Contributed Perl Documentation						  zshdb(1)

NAME
zshdb - zsh debugger SYNOPSIS
zshdb [options] [--] script-name [script options] zshdb [options] -c execution-string DESCRIPTION
"zshdb" is a zsh script to which arranges for another zsh script to be debugged. The debugger has a similar command interface as gdb(1). If you used zshdb script and need to pass options to the script to be debugged, add "--" before the script name. That will tell zshdb not to try to process any further options. OPTIONS
-h | --help Print a usage message on standard error and exit with a return code of 100. -A | --annotation level Sets to output additional stack and status information which allows front-ends such as emacs to track what's going on without polling. This is needed in for regression testing. Using this option is equivalent to issuing: set annotation LEVEL inside the debugger. -B | --basename In places where a filename appears in debugger output give just the basename only. This is needed in for regression testing. Using this option is equivalent to issuing: set basename on inside the debugger. -n | --nx | --no-init Normally the debugger will read debugger commands in "~/.zshdbinit" if that file exists before accepting user interaction. ".zshdbinit" is analogus to Perl's ".perldb" or GNU gdb's ".gdbinit": a user might want to create such a debugger profile to add various user-specific customizations. Using the "-n" option this initialization file will not be read. This is useful in regression testing or in tracking down a problem with one's ".zshdbinit" profile. -c | --command command-string Instead of specifying the name of a script file, one can give an execution string that is to be debugged. Use this option to do that. -q | --quiet Do not print introductory version and copyright information. This is again useful in regression testing where we don't want to include a changeable copyright date in the regression-test matching. -x | --eval-command debugger-cmdfile Run the debugger commands debugger-cmdfile before accepting user input. These commands are read however after any ".zshdbinit" commands. Again this is useful running regression-testing debug scripts. -L | --library debugger-library The debugger needs to source or include a number of functions and these reside in a library. If this option is not given the default location of library is relative to the installed zshdb script: "../lib/zshdb". -T | --tempdir temporary-file-directory The debugger needs to make use of some temporary filesystem storage to save persistent information across a subshell return or in order to evaluate an expression. The default directory is "/tmp" but you can use this option to set the directory where debugger temporary files will be created. -t | --tty tty-name Debugger output usually goes to a terminal rather than stdout or stdin which the debugged program may use. Determination of the tty or pseudo-tty is normally done automatically. However if you want to control where the debugger output goes, use this option. -V | --version Show version number and no-warranty and exit with return code 1. BUGS
The way this script arranges debugging to occur is by including (or actually "source"-ing) some debug-support code and then sourcing the given script or command string. One problem with sourcing a debugged script is that the program name stored in $0 will not be the name of the script to be debugged. The debugged script will appear in a call stack not as the top item but as the item below "zshdb". The "zshdb" script option assume a version of zsh with debugging support, zsh 4.3.6-dev-2 or later. The debugger slows things down a little because the debugger has to intercept every statement and check to see if some action is to be taken. SEE ALSO
o <http://bashdb.sourceforge.net/bashdb.html> - Until a full manual is written, this manual for a similar bash debugger may give some guidance. The two debuggers have similar command interfaces (and code). o <http://bashdb.sourceforge.net> - the homepage for the project for the family of debugger, zshdb, bashdb. AUTHOR
The current version is maintained (or not) by Rocky Bernstein. COPYRIGHT
Copyright (C) 2009 Rocky Bernstein This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 0.06.git 2010-10-31 zshdb(1)
All times are GMT -4. The time now is 08:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy