Sponsored Content
Operating Systems Solaris Scripiting quote and variable issues Post 302467508 by DGPickett on Friday 29th of October 2010 03:41:15 PM
Old 10-29-2010
Quote:
Originally Posted by striker0010
DGPickett,

For reference ./animals looks like the following

cat,tiger,Fluffy
sheep,blackSheep,Spike
ect....

Am I to understand that placing a command such as this:

Code:
echo"grep cat ./animals"

will print the output of that command to the screen, so in this example I would get:
cat,tiger,Fluffy on the screen ?
Well, yes, like this:
Code:
echo"grep cat ./animals" | rsh animal_host ksh

Essentially, you are generating a script dynamically, sending it over to the host for ksh to run. Don't forget something like ". ./.profile" if you need snvironment. I favor single quotes unless I want variable expansion, as they have fewer metacharacters. Parens are very nice for this, as you can mix in all sorts of commands, and as always, you can preview the created script for validity:
Code:
(
  echo '. ./.profile'
  echo 'grep cat ./animals'
 ) | rsh animal_host ksh

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with double quote and string variable

Hello, i have a file output.txt which contains a single line with a list of files with quotes : "file1.ext" "file2.ext" "file3.ext" In a shell script, I want to retrieve the line and use it as a variable in a command like : zip archive.zip $LIST I cant get it work. When I physically type... (6 Replies)
Discussion started by: mattemp
6 Replies

2. Shell Programming and Scripting

Capturing Data between first quote and next quote

I have input file like RDBMS FALIURE UTY8703 'USER_WORK.TEST' .HIghest return code '12' I want to parse data which comed between first quote till next quote USER_WORK.TEST can you please suggest how to do that (4 Replies)
Discussion started by: scorp_rahul23
4 Replies

3. Shell Programming and Scripting

Variable issues

Hey guys, I have just started getting into shell scripting, ive been self educating myself with it and have run into a snag. I am trying to make a very simple addition script. The script would be passed a number of parameters (numbers) and it would add them all together. I can do this fine... (2 Replies)
Discussion started by: bert682
2 Replies

4. Shell Programming and Scripting

Quote and variable

The command line bellow works fine by itself. /opt/csw/bin/rsync -azq --delete -e "ssh -i /.ssh/ss" /home/ me@myaccount.storage.com:/home/ Now I would like to introduce some variable into it and make a .sh file such as bellow and it does not work anymore. I guess the part -e "ssh -i /.ssh/ss" has... (4 Replies)
Discussion started by: ngungo
4 Replies

5. Shell Programming and Scripting

variable issues

Hope someone can help me. I have 2 outputs 1 2 3 4 5 a b c d e basically, I'd like to loop thru these outputs and print out the results below 1/a 2/b 3/c 4/d 5/e Thanks, (16 Replies)
Discussion started by: kkkk
16 Replies

6. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

7. Shell Programming and Scripting

replacing a quote in some lines with multiple quote fields

i want to replace mistaken quotes in line starting with tag 300 and relocate the quote in the correct position so the input is 223;25 224;20100428064823;1;0;0;0;0;0;0;0;8;1;3;9697;18744;;;;;;;;;;;; 300;X;Event:... (3 Replies)
Discussion started by: wradwan
3 Replies

8. Windows & DOS: Issues & Discussions

Quote issues in VB.NET

Running into a small issue and not sure on the syntax to get around it... I need to execute: sc \\iamdc.grhq.XXX.com query "DirXMLRemote 8000" My issue though is the quotes. How to I keep the quotes only contained within the command instead of the logic using them? Not sure if I am... (1 Reply)
Discussion started by: LRoberts
1 Replies

9. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies

10. Shell Programming and Scripting

Help/Advise please for converting space delimited string variable to comma delimited with quote

Hi, I am wanting to create a script that will construct a SQL statement based on a a space delimited string that it read from a config file. Example of the SQL will be For example, it will read a string like "AAA BBB CCC" and assign to a variable named IN_STRING. I then concatenate... (2 Replies)
Discussion started by: newbie_01
2 Replies
DH_COMPRESS(1)							     Debhelper							    DH_COMPRESS(1)

NAME
dh_compress - compress files and fix symlinks in package build directories SYNOPSIS
dh_compress [debhelperoptions] [-Xitem] [-A] [file...] DESCRIPTION
dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks that pointed to the files before they were compressed are updated to point to the new files. By default, dh_compress compresses files that Debian policy mandates should be compressed, namely all files in usr/share/info, usr/share/man, files in usr/share/doc that are larger than 4k in size, (except the copyright file, .html and other web files, image files, and files that appear to be already compressed based on their extensions), and all changelog files. Plus PCF fonts underneath usr/share/fonts/X11/ FILES
debian/package.compress These files are deprecated. If this file exists, the default files are not compressed. Instead, the file is ran as a shell script, and all filenames that the shell script outputs will be compressed. The shell script will be run from inside the package build directory. Note though that using -X is a much better idea in general; you should only use a debian/package.compress file if you really need to. OPTIONS
-Xitem, --exclude=item Exclude files that contain item anywhere in their filename from being compressed. For example, -X.tiff will exclude TIFF files from compression. You may use this option multiple times to build up a list of things to exclude. -A, --all Compress all files specified by command line parameters in ALL packages acted on. file ... Add these files to the list of files to compress. CONFORMS TO
Debian policy, version 3.0 SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_COMPRESS(1)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy