Sponsored Content
Top Forums Shell Programming and Scripting execute command stored in a string Post 302433700 by dips_ag on Wednesday 30th of June 2010 09:17:55 AM
Old 06-30-2010
execute command stored in a string

Hi,

Here's the problem I am facing.
This is just an example:

Code:
 
list_files.ksh
------------
dir=$1
match=$2
 
var="ls $dir | grep $match"
files=`"$var"`

I get the below error on executing the above script:
Code:
./list_files.ksh[5]: ls /home/my_files | grep xml: not found

I know I am doing something very silly. Can you please tell me?

-dips
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute an Oracle stored procedure from a shell scrip

Here is a snippet of my code: if then echo "\n Deleting all reports older than 24 hours. \n" >> $logfile ls -l $FileName >> $logfile ... (1 Reply)
Discussion started by: mh53j_fe
1 Replies

2. Shell Programming and Scripting

how to get the string stored in a variable in a line???

Hi all, I want to search for a data type in a line.For this in a loop i am checking for $DATA_TYPE in a line using grep.But grep is not able to find when i give this. Can any one tell me how to check string in $DATA_TYPE variable in line usign grep (or) any other way to do the above task. ... (4 Replies)
Discussion started by: jisha
4 Replies

3. Shell Programming and Scripting

How to build a command into a string rather than execute the command

I'm trying to populate a command line into a variable. It appears to be executing, instead. Here's an example: mycmd='' if ...; then $mycmd='sudo ' fi $mycmd=$mycmd 'sed -i prev s/aaa/bbb/' $myfile res=`$mycmd` (I'm also not sure of the best way to execute the command from the... (1 Reply)
Discussion started by: littlejon
1 Replies

4. Shell Programming and Scripting

How to use a stored string in function call

Hi All I have written code for storing data in a string based on pattern. whenever i tried to use in a function call its not getting there. Actually the same logic was applied for another string..then i can use the string at any function. the code goes like this /mp metadata/{... (1 Reply)
Discussion started by: madhaviece
1 Replies

5. Shell Programming and Scripting

How to execute the stored procedure from shell script

How to execute the stored procedure from shell script and is there any possibility to print the dbms output in a log file. (2 Replies)
Discussion started by: dineshmurs
2 Replies

6. Shell Programming and Scripting

Execute stored procedure through script in sybase database and store the output in a .csv file

Hi, I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output. I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies

7. Shell Programming and Scripting

KSH to execute stored procs/ctrl files

I am needing to call sqlplus and sqlldr in the same korn shell script. Below are the steps that I need to accomplish. I am new to Oracle shell scripting so an example would be great. CBOB_LOAD.KSH - script name Calls Oracle stored procedure sp_CBOB_CLEAR_LN_STAGING (SERVER: TESTSVR100) Calls... (0 Replies)
Discussion started by: acewilli
0 Replies

8. Shell Programming and Scripting

Unable to execute Stored Procedure from CRON

Hi, I am very new to this environment - I hope this is the right platform to discuss my issue: I created a CRON job to run a Stored Procedure from our database - Sybase. Within the Stored Procedure there is a TRUNCATE table and CREATE table function. the CRON job fails to run with... (2 Replies)
Discussion started by: pizzazzz
2 Replies

9. Shell Programming and Scripting

Searching a string stored in other file

I need to design a script which can do the following: I have two files abc.txt and constant.hmtl abc.txt contains some 5 string that I need to see if they exist in contants.html. Constants.hmtl is a very large file around 800 lines. I want to search all the strings present in file... (8 Replies)
Discussion started by: hemasid
8 Replies

10. UNIX for Beginners Questions & Answers

Grep a sub-string from a string stored in a variable.

For example: I am grepping "Hello" from a file and there are 10 matches. So all ten lines with match will get stored into a variable($match). Now I want to ignore those lines which have "Hi" present in that. Currently I tried this: match = grep "Hello" file | grep -v "Hi" file But that's not... (2 Replies)
Discussion started by: pavan
2 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy