04-01-2012
ksh view std err state
I would like to know if a command works.
"command" 2>/dev/null
When I issue the command, the error is suppressed. How can I tell whether there was an error?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this.
Thanks (2 Replies)
Discussion started by: 0ktalmagik
2 Replies
2. Shell Programming and Scripting
The following command does not work under cygwin bash.
ant debug >log 2>&1 && ant image >>log 2>>&1 & pid=$!
It gives the error "-bash: sysntax error near unexpected token '&'".
Is there a way I can redirect std output and std error to file "log" for both the commands "ant debug" and "ant... (1 Reply)
Discussion started by: siegfried
1 Replies
3. Shell Programming and Scripting
have a script in ksh called file1
#!/bin/ksh
cat my.html
---------------------------
and a html file hy.html
can u tell me that if i execute "file1" script it will open hy.html bt here it is showing the all the tags along with text.........
it should open the browser part... (2 Replies)
Discussion started by: ali560045
2 Replies
4. Programming
Hello all
Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting
The fallowing error :
Undefined first referenced
symbol in file
std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
Discussion started by: umen
0 Replies
5. Shell Programming and Scripting
Hi All,
I am trying to run the below cmd thro' a script.
awk 'NR>=48&&NR<=(58-1)' $IN_FILE_NAME | tee $OUT_FILE_NAME
but I am getting an err while running the script. It gives the below err msg :
awk: syntax error near line 1
awk: bailing out near line 1
(P.S Note: When run the... (6 Replies)
Discussion started by: askumarece
6 Replies
6. Shell Programming and Scripting
I am working on a script that lists files in a directory with a few file attributes depending on what option the user specifies at the command prompt. The script uses Getopt::Std and takes two switches.
The first switch allows the user to specify a directory, the second switch gives a long... (3 Replies)
Discussion started by: Breakology
3 Replies
7. Shell Programming and Scripting
Hello gurus, this is part of my script:
ls -1 ${MyFile} >> ${dir_log}ListFile${Now}.tmp
FILENUM=`cat ${dir_log}ListFile${Now}.tmp| wc -l | awk '{print $1}'`>> /dev/null
if
then
writeError "ERRORE: no file in directory for type ${FileName}!" >> ${LogFileName}
Close 1
fi... (7 Replies)
Discussion started by: GERMANICO
7 Replies
8. Shell Programming and Scripting
Bonjour,
I have a large script with a lot of print statements and misc commands. Standard and error outputs are redirected like into the following code :
#!/usr/bin/ksh
LOG=/<some dir>/log
> $LOG
exec >>${LOG} 2>>${LOG}
print aaaaa
print bbbbb
print ccccc
...
some_cmd
That way,... (5 Replies)
Discussion started by: Fundix
5 Replies
9. AIX
Hi Admins,
I am having a whole system lpar in open firmware state on HMC.
How can I bring it to running state ?
Let me know. Thanks. (2 Replies)
Discussion started by: snchaudhari2
2 Replies
10. What is on Your Mind?
See attached video for a demo on how to move back and forth from the desktop view to the mobile view.
Currently this only works for the home page, but I will work on some new PHP code in the future to make this work with the page we are currently on.
Edit: The issue with making every page ... (2 Replies)
Discussion started by: Neo
2 Replies
mt(1) General Commands Manual mt(1)
Name
mt - magnetic tape manipulating program
Syntax
mt [-f tapename] command [count]
Description
The command permits the operation of a magnetic tape drive.
Options
The -f flag option uses the specified tape device (next argument) in place of either that tape device defined by your TAPE environment
variable (.login or .profile) or /dev/nrmt0h.
Some operations may be performed multiple times by specifying count. By default, performs the requested operation once.
The command argument defines the operation to be performed. Only as many characters as are required to uniquely identify a command need be
specified.
The following is a list of commands:
bsf Backspace count files.
bsr Backspace count records.
cache Allows to use the cache buffer on a tape drive that has the cache buffer feature.
clhrdsf Clear hardware/software problem. Works with tape drives which use the TMSCP tape controller interface This command is
restricted to root access only.
clserex Clear serious exception. Works with tape drives which use the TMSCP tape controller interface
clsub Clear subsystem. Works with tape drives which use the TMSCP tape controller interface This command is restricted to
root access only.
eof, weof Write count end-of-file marks at the current position on the tape.
eotdis Disable end-of-tape detection. When the end of tape is reached, the tape will run off the reel. Only the superuser
can issue this command. The command remains in effect for the device until end-of-tape detection is enabled with the
eoten command.
eoten Enable end-of-tape detection. When the end-of-tape markers are reached, the tape is halted on the reel, between the
two end-of-tape markers. Only the superuser can issue this command. The command remains in effect for the device
until end-of-tape detection is disabled with the eotdis command. This is the default mode after a system boot.
fsf Forward-space count files.
fsr Forward-space count records.
nocache Disables the use of the cache buffer for any tape drive that has the cache buffer feature.
offline, rewoffl Rewind the tape and place the tape unit off-line.
retension Retensions the tape. Retension means moving the tape one complete pass between EOT and BOT.
rewind Rewind the tape.
status Print status information about the tape unit.
Examples
This example shows how to rewind the tape
mt -f /dev/rmt0l rewind
This example shows how to backspace the tape nmt1h three files:
mt -f /dev/nrmt1h bsf 3
This example shows how to write two end-of-file marks at the current position on tape nmt6h:
mt -f /dev/nrmt6h eof 2
Return Values
In shell scripts, returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation
failed.
Files
/dev/rmt?h or /dev/rmt?l
Raw magnetic tape interface with rewind when closed
/dev/nmt?h or /dev/nmt?l
Raw magnetic tape interface with no rewind when closed
See Also
dd(1), tar(1), ioctl(2), mtio(4), tms(4), environ(7)
mt(1)