08-05-2008
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
If i write this statement in a Korn Shell script
RCODE=$?
what possibly does it eman? (3 Replies)
Discussion started by: ranjita.c
3 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
3. Shell Programming and Scripting
All I want to do is find out if the string 'NO' is in a file by checking for a return code of 0 if there is a match. The grep works fine on the command line directly naming the file but I am obviously not using the correct syntax within the shell script as I consistently get the error message
... (5 Replies)
Discussion started by: SusanDAC
5 Replies
4. Shell Programming and Scripting
Hey Folks and Gurus there
I am trying to replicate this logic in bash :
(1) if ; then
function1 parameters &
function2 parameters &
fi
Is there an easy method esp one with regex that can do this comparision.
e.g. $var is compared to this list ( case regardless ) (... (1 Reply)
Discussion started by: sieger007
1 Replies
5. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
6. Solaris
Hi,
i'm posting this in the Solaris forum although maybe it should be better in the General unix forum, I'm formatting an output witht he following command:
crontab -l | grep GBOUAT8 | grep UTP | grep -i stop | sed 's/\\//'
08 2 * * 2-6 /apps/sum_glob/gbo_uat/sparse/bin/dmg_cronlaunch -ENVI... (2 Replies)
Discussion started by: Cvg
2 Replies
7. Shell Programming and Scripting
I wrote this script
#!/bin/bash
var=`du -sch /var/log/messages;du -sch /var/log/maillog`
echo $var
I am getting result as follows.
# sh my.sh
2.1M /var/log/messages 2.1M total 296K /var/log/maillog 296K total
I need it like below
2.1M /var/log/messages
296K... (3 Replies)
Discussion started by: anilcliff
3 Replies
8. Shell Programming and Scripting
I want to store the return value of
grep -c string filename
into a variable, say count. How do I do that?
For example if grep -c "string" "filename" shows 0 on executing it in the sh shell then I want to store this 0 in a variable. Is it possible? :D (5 Replies)
Discussion started by: navienavnav
5 Replies
9. UNIX for Advanced & Expert Users
I am more of a newbie, but wanted to post this in this forum as I was afraid no one would look at it in unix forums as it concerns shell scripting. I have a shell script that now runs fine with the exclusion of one line:
x=`su nbadmin -c "ssh -t servery /usr/openv/netbackup/bin/bplist -C... (7 Replies)
Discussion started by: newbie2010
7 Replies
10. Shell Programming and Scripting
Hi,
My command is getting stuck while running it.
observed that the grep command doesn't returned any data ($? was 1) and it failed.
This command is assigned into the variable and used in other command as script progresses. To continue the script output, i have to press ^C twice and script... (2 Replies)
Discussion started by: abhii
2 Replies
LEARN ABOUT OPENDARWIN
unknown
unknown(n) Tcl Built-In Commands unknown(n)
__________________________________________________________________________________________________________________________________________________
NAME
unknown - Handle attempts to use non-existent commands
SYNOPSIS
unknown cmdName ?arg arg ...?
_________________________________________________________________
DESCRIPTION
This command is invoked by the Tcl interpreter whenever a script tries to invoke a command that doesn't exist. The default implementation
of unknown is a library procedure defined when Tcl initializes an interpreter. You can override the default unknown to change its func-
tionality. Note that there is no default implementation of unknown in a safe interpreter.
If the Tcl interpreter encounters a command name for which there is not a defined command, then Tcl checks for the existence of a command
named unknown. If there is no such command, then the interpreter returns an error. If the unknown command exists, then it is invoked with
arguments consisting of the fully-substituted name and arguments for the original non-existent command. The unknown command typically does
things like searching through library directories for a command procedure with the name cmdName, or expanding abbreviated command names to
full-length, or automatically executing unknown commands as sub-processes. In some cases (such as expanding abbreviations) unknown will
change the original command slightly and then (re-)execute it. The result of the unknown command is used as the result for the original
non-existent command.
The default implementation of unknown behaves as follows. It first calls the auto_load library procedure to load the command. If this
succeeds, then it executes the original command with its original arguments. If the auto-load fails then unknown calls auto_execok to see
if there is an executable file by the name cmd. If so, it invokes the Tcl exec command with cmd and all the args as arguments. If cmd
can't be auto-executed, unknown checks to see if the command was invoked at top-level and outside of any script. If so, then unknown takes
two additional steps. First, it sees if cmd has one of the following three forms: !!, !event, or ^old^new?^?. If so, then unknown carries
out history substitution in the same way that csh would for these constructs. Finally, unknown checks to see if cmd is a unique abbrevia-
tion for an existing Tcl command. If so, it expands the command name and executes the command with the original arguments. If none of the
above efforts has been able to execute the command, unknown generates an error return. If the global variable auto_noload is defined, then
the auto-load step is skipped. If the global variable auto_noexec is defined then the auto-exec step is skipped. Under normal circum-
stances the return value from unknown is the return value from the command that was eventually executed.
SEE ALSO
info(n), proc(n), interp(n), library(n)
KEYWORDS
error, non-existent command
Tcl unknown(n)