Passing arguments with " symbols


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Passing arguments with " symbols
# 8  
Old 09-04-2008
Quote:
Originally Posted by era
Using echo | grep is really kind of excessive when you have case

Code:
case $i in *' '*) echo file_out="$out_file";; esac

Right, but the intention was to give an approach how to accomplish his goal.

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to avoid "Too many arguments" error, when passing a long String literal as input to a command?

Hi, I am using awk here. Inside an awk script, I have a variable which contains a very long XML data in string format (500kb). I want to pass this data (as argument) to curl command using system function. But getting Too many arguments error due to length of string data(payloadBlock). I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

2. Shell Programming and Scripting

Passing multiple arguments

Hi, I know with getopts you can pass arguments from the command line ./script -ab -c apple But it doesn't support 2 or more arguments for ONE option. Is there any other way to do this? Thanks (2 Replies)
Discussion started by: testa500
2 Replies

3. Shell Programming and Scripting

Passing arguments--Error

Hi, i have a file.txt with data Bangalore Chennai Hyd filename of the script is: new.sh result=`cat file.txt | grep $1` if then echo pass else echo fail fi i am executing the file in the cmd line as "sh new.sh Bangalore" o/p is pass if i give "sh new.sh delhi" o/p is... (6 Replies)
Discussion started by: harsha85
6 Replies

4. Shell Programming and Scripting

Reading a string and passing passing arguments to a while loop

I have an for loop that reads the following file cat param.cfg val1:env1:opt1 val2:env2:opt2 val3:env3:opt3 val4:env4:opt4 . . The for loop extracts the each line of the file so that at any one point, the value of i is val1:env1:opt1 etc... I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies

5. Programming

Passing arguments to shellcode

Is there any way I could pass arguments to shellcode. My goal is to store a program in a image file, and have another program read and run the code with arguments in memory. Currently I can store a program in a image file, then read it back to the hard-drive run it normally then delete it when... (5 Replies)
Discussion started by: image28
5 Replies

6. Shell Programming and Scripting

Perl: How to Print symbols like " and ;

Hi, How do I print a line with symbols in a file? Exp: If I want to print line: Hi "Lisa;John" Command: print FILE "Hi "Lisa;John""; - will give me error Bareword found where operator expected... Can someone advise how can I print any line consiting symbols like example above. Thanks... (3 Replies)
Discussion started by: SSGKT
3 Replies

7. UNIX for Dummies Questions & Answers

Passing arguments

I need to pass arguments to a shell script.My batch is calling some java program. ################# x=$1 y=$2 java -classpath program ################### if first parameter and second parameter is null then java -classpath program if first parameter is not null and second parameter is... (3 Replies)
Discussion started by: mnjx
3 Replies

8. Shell Programming and Scripting

passing arguments

Hi I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like ./abc def /file <directory location> In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after... (4 Replies)
Discussion started by: zmfcat1
4 Replies

9. Shell Programming and Scripting

Passing Arguments-Help

Hi, I have a script which adds the user credentials to an ldap server. Im passing the variables as below.. /path/my_script $uname $pwd $environ ${deposit} If i enter some special characters like ';' in $pwd, script returns an error which is set to display if the user enters... (5 Replies)
Discussion started by: Tuxidow
5 Replies

10. UNIX for Dummies Questions & Answers

passing arguments

I'm trying to pass a filename, or all the files in the current directory to the ls command with a script. Unsuccessful so far, here are a few of my attempts: #!/bin/ksh read fname #if (( $# > 0 )); then $fname | ls -l #fi this produces a long listing of all the files in my current... (4 Replies)
Discussion started by: jpprial
4 Replies
Login or Register to Ask a Question
fspec(4)							   File Formats 							  fspec(4)

NAME
fspec - format specification in text files DESCRIPTION
It is sometimes convenient to maintain text files on the system with non-standard tabs, (tabs that are not set at every eighth column). Such files must generally be converted to a standard format, frequently by replacing all tabs with the appropriate number of spaces, before they can be processed by system commands. A format specification occurring in the first line of a text file specifies how tabs are to be expanded in the remainder of the file. A format specification consists of a sequence of parameters separated by blanks and surrounded by the brackets <: and :>. Each parameter consists of a keyletter, possibly followed immediately by a value. The following parameters are recognized: ttabs The t parameter specifies the tab settings for the file. The value of tabs must be one of the following: o A list of column numbers separated by commas, indicating tabs set at the specified columns. o A '-' followed immediately by an integer n, indicating tabs at intervals of n columns. o A '-' followed by the name of a ``canned'' tab specification. Standard tabs are specified by t-8, or equivalently, t1,9,17,25, etc. The canned tabs that are recognized are defined by the tabs(1) command. ssize The s parameter specifies a maximum line size. The value of size must be an integer. Size checking is performed after tabs have been expanded, but before the margin is prepended. mmargin The m parameter specifies a number of spaces to be prepended to each line. The value of margin must be an integer. d The d parameter takes no value. Its presence indicates that the line containing the format specification is to be deleted from the converted file. e The e parameter takes no value. Its presence indicates that the current format is to prevail only until another format specifi- cation is encountered in the file. Default values, which are assumed for parameters not supplied, are t-8 and m0. If the s parameter is not specified, no size checking is performed. If the first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The following is an example of a line containing a format specification: * <:t5,10,15 s72:> * If a format specification can be disguised as a comment, it is not necessary to code the d parameter. SEE ALSO
ed(1), newform(1), tabs(1) SunOS 5.11 3 Jul 1990 fspec(4)