Sponsored Content
Top Forums Shell Programming and Scripting how to pass variable to grep? Post 302147957 by Ygor on Thursday 29th of November 2007 06:27:02 AM
Old 11-29-2007
Well, you would certainly need to use "$SPAMH", since it has some spaces, but try using set -x to see what's going-on.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass a variable to Awk ?

I am trying to pass 2 shell variable's ("START" and "END") define earlier in the script to this awk statement, but i can't seem to pass it on. PLs help. set START = xxxx set END = yyyy set selected_file = `awk '/$START/,/$END/' filename` (24 Replies)
Discussion started by: Raynon
24 Replies

2. UNIX for Dummies Questions & Answers

How To Pass an Array Variable

Hi, I have a master BASH shell script where I define a bunch of variables: $var1=why $var2=is $var3=(this so hard) I would then like to call another shell script and pass these variables to it: $script2 $var1 $var2 $var3 This works fine for var1 and var2. However, var3 is an array,... (9 Replies)
Discussion started by: msb65
9 Replies

3. Shell Programming and Scripting

Pass variable to sql

Please help. I got these error. I'm try to pass variable extract from data-file.txt to sql file(select.sql). cat: cannot open select cat: cannot open * cat: cannot open from cat: cannot open user cat: cannot open where cat: cannot open name=$list; #!/bin/bash list=`sed q... (3 Replies)
Discussion started by: killboy
3 Replies

4. Shell Programming and Scripting

Problem with * when pass into variable.

Hello expert. I have a little problem here. I write a script and stuck some bug to fix. I found the problem was about * and a sample of script is below. line 1 is print * out but line 3 print all name of files in the script's path. (but I want *) I want to contain * in variable... (3 Replies)
Discussion started by: MaYuMi
3 Replies

5. Shell Programming and Scripting

Pass variable to SFTP

Hi All, I am using SFTP command to transfer the file. SRC=`pwd` DIG=123 /bin/sftp -B /dev/stdin xyz@abc.net <<:: mput ${SRC}/GGG.${DIG}.tar.gz bye :: The problem is, after entring into sftp command, it is not taking variable values of SRC and DIG. can someone help me... (0 Replies)
Discussion started by: ace_friends22
0 Replies

6. Shell Programming and Scripting

How to pass a function with a variable parameter into another variable?

Hello again :) Am currently trying to write a function which will delete a record from a file. The code currently looks as such: function deleteRecord() { clear read -p "Please enter the ID of the record you wish to remove: " strID ... (2 Replies)
Discussion started by: U_C_Dispatj
2 Replies

7. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

8. UNIX for Dummies Questions & Answers

Pass grep's Output to mv?

Hi! I was looking for files to clean out, and I remembered reading somewhere that you could pipe the output of grep to rm. But I prefer to mv stuff to ~/.Trash/ I thought I'd try something like this: ls ~/Library/Preferences/ |grep '.*.\.iTunes\.plist\..*' |xargs -J % mv % ~/.Trash/ I... (12 Replies)
Discussion started by: sudon't
12 Replies

9. Shell Programming and Scripting

How to pass variable to a query?

Hi All, How to pass date variable to a query? I have tried the below one , but it's not working. ost.ksh #!/bin/ksh v_date=$1 var=$(sqlplus -s $ORACON <<ENDOFSQL SELECT TO_DATE('$v_date','DD-MON-YYYY'),-1) FROM DUAL; exit; ENDOFSQL ) #End I have executed as below. (7 Replies)
Discussion started by: ROCK_PLSQL
7 Replies

10. UNIX for Beginners Questions & Answers

Need to pass variable in a command and assign value to a variable

Hello All, Hope you're doing well ! I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted. header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies
libcaca-style(3caca)						      libcaca						      libcaca-style(3caca)

NAME
libcaca-style - Libcaca coding style General guidelines A pretty safe rule of thumb is: look at what has already been done and try to do the same. o Tabulations should be avoided and replaced with eight spaces. o Indentation is generally 4 spaces. o Lines should wrap at most at 79 characters. o Do not leave whitespace at the end of lines. o Do not use multiple spaces for anything else than indentation. o Code qui fait des warnings == code de porc == deux baffes dans ta gueule C coding style Try to use short names whenever possible (i for indices, w for width, cv for canvas...). Macros are always uppercase, variable and function names are always lowercase. Use the underscore to separate words within names: #define BROKEN 0 #define MAX(x, y) ((x > y) ? (x) : (y)) unsigned int x, y, w, h; char *font_name; void frobulate_every_three_seconds(void); const is a suffix. It's char const *foo, not const char *foo. Use spaces after commas and between operators. Do not use spaces after an opening parenthesis or before a closing one: a += 2; b = (a * (c + d)); x = min(x1, x2, x3); Do not put a space between functions and the corresponding opening parenthesis: int function(int); A space can be inserted after keywords such as for, while or if, but consistency with the rest of the page is encouraged: if(a == b) return; if (p == NULL) Do not put parentheses around return values: return a + (b & x) + d[10]; Opening braces should be on a line of their own, aligned with the current block. Braces are optional for one-liners: int function(int a) { if(a & 0x84) return a; if(a < 0) { return -a; } else { a /= 2; switch(a) { case 0: case 1: return -1; break; default: return a; } } } C++ coding style Nothing here yet. Version 0.99.beta18 Fri Apr 6 2012 libcaca-style(3caca)
All times are GMT -4. The time now is 12:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy