09-26-2008
callenge to masters
say i need to run the script OTP_Extract.sh that require some command line args eg -
$OTP_Extract.sh -v '" 0"' -m DAILY
-v is to passes " 0" to this. number of spaces around 0 are important.
But I need to run this by other script keeping all command OTP_Extract.sh and options -v '" 0"' -m DAILY in the command line args of other scritp ,say a.sh
I 'll use a.sh as -
$a.sh 'script and args'
and a.sh is like -
$cat a.sh
EXECUTE="$@"
ksh "${EXECUTE}"
The problem is that $@ doesn't pass 'script and args' properly if it have single quotes in between . I've tried escaping by back slash , but it doesn't work.
What I need is that If I echo $EXECUTE I shoud get -
OTP_Extract.sh -v '" 0"' -m DAILY
Please help.
10 More Discussions You Might Find Interesting
1. Programming
HI
I have a messaging s/w daemon(TIBCO rvrd) provided by vendor which will accept connections from various clients and routes messages to the destinations. In order to route it internally uses two ports(one tcp adn one udp).
I want to know on which port(tcp/udp) it is transmitting... (3 Replies)
Discussion started by: axes
3 Replies
2. Shell Programming and Scripting
I am using the while-loop to read a file.
The file has lines with null-terminated strings (words, actually.)
What I have by that reading - just a first word up to '\0'!
I need to have whole string up to 'new line' - (LF, 10#10, 16#A)
What I am doing wrong?
#make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies
3. Shell Programming and Scripting
Hi,
I'm trying to run the following command using sh -c
ie
sh -c "while read EachLine
do
rm -f $EachLine ;
done < file_list.lst;"
It doesn't seem to do anything.
When I run this at the command line, it does remove the files contained in the list so i know the command works
ie... (4 Replies)
Discussion started by: chrispward
4 Replies
4. Shell Programming and Scripting
Hi. I'm trying to write a script that reads a line on a file and runs a different command for a different line output.
For example, if it finds the word "Kuku" on the line it sends mail to Kuku@kuku.com. Otherwise, it sends mail to Lulu@lulu.com.
TIA. (2 Replies)
Discussion started by: Doojek9
2 Replies
5. Shell Programming and Scripting
I am new to schell scripting . My objective is to write a ksh shell script that performs following tasks: -
1. Script reads all command line arguments (arguments are file names) and checks if it contains charachters "abc" in it.
2. If it contains "abc" it will execute a binary file xyz <command... (3 Replies)
Discussion started by: acmilan
3 Replies
6. AIX
Hi All,
I have a complicated requirement where in I have a "root" user and a user named "xeadmin" I want to take sudo of "xeadmin" by command sudo su - xeadmin. Later i need to hit 2 enter keys as there are 2 read line commands inserted in profile of "xeadmin" and I reach command prompt, i need... (1 Reply)
Discussion started by: hiteshsathawane
1 Replies
7. Shell Programming and Scripting
Team ,
I am trying to write a case condition for database backups.But I am unable to make the script to read input from command line .
while true ;do
read -p "Do You Wish To Take Database Backup ?? " yn
case $yn in
*) echo " YES take backup ";;
*) echo " NO BACKUP " ;;
... (9 Replies)
Discussion started by: rocking77
9 Replies
8. Shell Programming and Scripting
I'm trying to stop reading a file until the end of the file is reached or a defined delimiter line is reached. Some how I need to test the fail state of the last 2 commands, not just the last command.
echo -e "hello\ngoodbye\n####\ntesting" | while read line; ]; do echo "$line"; done
hello... (4 Replies)
Discussion started by: Michael Stora
4 Replies
9. Shell Programming and Scripting
Hi ALL,
I have a requirement like this.
1.GET ALL TABLE NAME (just table name) keep in file
2.Read line by line and get the count of table from tablename files.
tablename detail has a sql statement "db2 select tabname from syscat.tables" (1 Reply)
Discussion started by: netdbaind
1 Replies
10. Shell Programming and Scripting
Hi,
I have some 2000 names in a table like below.
Java
Oracle/SQL
ANSI SQL
SQL,DWH,DB
DB&Java
And by using for loop in my code i am able to get a single word but if there is any special character or space then it is considering as a next line.
I have to execute the below queries in... (10 Replies)
Discussion started by: Samah
10 Replies
tclsh(1) Tcl Applications tclsh(1)
__________________________________________________________________________________________________________________________________________________
NAME
tclsh - Simple shell containing Tcl interpreter
SYNOPSIS
tclsh ?-encoding name? ?fileName arg arg ...?
_________________________________________________________________
DESCRIPTION
Tclsh is a shell-like application that reads Tcl commands from its standard input or from a file and evaluates them. If invoked with no
arguments then it runs interactively, reading Tcl commands from standard input and printing command results and error messages to standard
output. It runs until the exit command is invoked or until it reaches end-of-file on its standard input. If there exists a file .tclshrc
(or tclshrc.tcl on the Windows platforms) in the home directory of the user, interactive tclsh evaluates the file as a Tcl script just
before reading the first command from standard input.
SCRIPT FILES
If tclsh is invoked with arguments then the first few arguments specify the name of a script file, and, optionally, the encoding of the |
text data stored in that script file. Any additional arguments are made available to the script as variables (see below). Instead of
reading commands from standard input tclsh will read Tcl commands from the named file; tclsh will exit when it reaches the end of the
file. The end of the file may be marked either by the physical end of the medium, or by the character, "