11-05-2001
It looks like you are passing 11 command line args.
(the 3rd one is missing a quote - typo?)
The "" and "" I assume are "empty" strings you wish to
pass as args 8 and 9?
You should be able to pass arguments containing
spaces in single or double quotes without a problem.
You can add...
set -x
...to your script and actually trace the variable assigments
during execution and hopfully find the error.
If your still having problems, it might help to see the script.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I want to read a file in UNIX line by line.
Can u suggest me any command for this? (4 Replies)
Discussion started by: VENC22
4 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
:confused:
can anyone throw some light on variable handling in UNIX script??
I want to know about the local variables we declare inside the UNIX script.
e.g.
i=10
OR
cat file1 | while read line
do
echo $line
done
etc.
Does UNIX have any data types
Can some one... (1 Reply)
Discussion started by: VENC22
1 Replies
3. Shell Programming and Scripting
Hi,
I am trying to replace a specific column values in a csv file with double quotes when I am find embedded spaces with in the fields.
Example:
SNO,NAME,ZIPCODE,RANK,SEX,ADDRESS
1,Robert,74538,12,34, M,Robert Street, NY
2,Sam,07564,13,M,12 Main Ave, CA
3,Kim, Ed,12345,14,M,123D ,... (1 Reply)
Discussion started by: techmoris
1 Replies
4. Shell Programming and Scripting
Hello,
I have written a shell script and suppose there is any error in the script. How i can do exception handling in shell script.for example i have below code
sqlplus -s <<uid>>/<<pwd>>@<<$ORACLE_SID>> <<EOF > 1_pid1.log
set pagesize 0
set feedback off
set heading off
set linesize 200... (1 Reply)
Discussion started by: rksingh003
1 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I have a requirement here where I am dealing with a dynamic file. Each record in the file can contain anywhere between 1(min) to 42(max) Reject codes. For example I may have one record in the file having 3 reject codes and another record having 5 reject codes. The reject codes will be... (2 Replies)
Discussion started by: sujainarayan
2 Replies
6. UNIX for Dummies Questions & Answers
Hi
I'm trying to ensure that I have catered for all situations with my getopt cases.
One other situation I want to cover is should the user enter the script without any preceding arguments eg:
./script_eg
I need the script to the direct the user to the helpfile
I have tried... (3 Replies)
Discussion started by: ladyAnne
3 Replies
7. Shell Programming and Scripting
Hi everyone,
I have been a big fan here since a couple years (since I started being an admin ...) and finally decided to become a member and help ppl and perhaps being helped
Now I have a problem that might interest some of the gurus.
I am abig fan of what I call "one liners". I am trying... (2 Replies)
Discussion started by: plmachiavel
2 Replies
8. Shell Programming and Scripting
I have a huge file semicolon( ; ) separated records are Pipe(|) delimited.
e.g
abc;def;ghi|jkl;mno;pqr|123;456;789
I need to replace the 50th field(semicolon separated) of each record with 9006. The 50th field can have no value e.g. ;;
Can someone help me with the appropriate command. (3 Replies)
Discussion started by: Gurkamal83
3 Replies
9. UNIX for Advanced & Expert Users
Hi All,
Iam trying to get a file processed and some lines have spaces...the below is not working
Want to remove empty line
Want to remove lines that start with #
Avoid line with substring WHOA
When trying to get the substring from the var also Iam having trouble
file is like VAR=VALUE,... (13 Replies)
Discussion started by: baanprog
13 Replies
10. Shell Programming and Scripting
I'm trying to handle some files with spaces in their name using "" or \ . Like "file 1" or file\ 1.
My current confusion can be expressed by the following shell script:
#!/bin/bash
touch "file 1" "file 2"
echo -n "ls: " ; ls
echo ---
for file in "file 1" "file 2" ; do
echo $file... (9 Replies)
Discussion started by: Ralph
9 Replies
eval(n) Tcl Built-In Commands eval(n)
__________________________________________________________________________________________________________________________________________________
NAME
eval - Evaluate a Tcl script
SYNOPSIS
eval arg ?arg ...?
_________________________________________________________________
DESCRIPTION
Eval takes one or more arguments, which together comprise a Tcl script containing one or more commands. Eval concatenates all its argu-
ments in the same fashion as the concat command, passes the concatenated string to the Tcl interpreter recursively, and returns the result
of that evaluation (or any error generated by it). Note that the list command quotes sequences of words in such a way that they are not
further expanded by the eval command.
EXAMPLES
Often, it is useful to store a fragment of a script in a variable and execute it later on with extra values appended. This technique is
used in a number of places throughout the Tcl core (e.g. in fcopy, lsort and trace command callbacks). This example shows how to do this
using core Tcl commands:
set script {
puts "logging now"
lappend $myCurrentLogVar
}
set myCurrentLogVar log1
# Set up a switch of logging variable part way through!
after 20000 set myCurrentLogVar log2
for {set i 0} {$i<10} {incr i} {
# Introduce a random delay
after [expr {int(5000 * rand())}]
update ;# Check for the asynch log switch
eval $script $i [clock clicks]
}
Note that in the most common case (where the script fragment is actually just a list of words forming a command prefix), it is better to |
use {*}$script when doing this sort of invocation pattern. It is less general than the eval command, and hence easier to make robust in |
practice. The following procedure acts in a way that is analogous to the lappend command, except it inserts the argument values at the
start of the list in the variable:
proc lprepend {varName args} {
upvar 1 $varName var
# Ensure that the variable exists and contains a list
lappend var
# Now we insert all the arguments in one go
set var [eval [list linsert $var 0] $args]
}
However, the last line would now normally be written without eval, like this: |
set var [linsert $var 0 {*}$args] |
SEE ALSO
catch(n), concat(n), error(n), interp(n), list(n), namespace(n), subst(n), tclvars(n), uplevel(n)
KEYWORDS
concatenate, evaluate, script
Tcl eval(n)