Sponsored Content
Full Discussion: handling spaces in unix
Top Forums Shell Programming and Scripting handling spaces in unix Post 9900 by rwb1959 on Monday 5th of November 2001 11:33:06 AM
Old 11-05-2001
It looks like you are passing 11 command line args.
(the 3rd one is missing a quote - typo?)
The "" and "" I assume are "empty" strings you wish to
pass as args 8 and 9?
You should be able to pass arguments containing
spaces in single or double quotes without a problem.


You can add...
set -x
...to your script and actually trace the variable assigments
during execution and hopfully find the error.

If your still having problems, it might help to see the script.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File handling in UNIX

Hi All, I want to read a file in UNIX line by line. Can u suggest me any command for this? (4 Replies)
Discussion started by: VENC22
4 Replies

2. UNIX for Dummies Questions & Answers

VARIABLE HANDLING in UNIX

Hi All, :confused: can anyone throw some light on variable handling in UNIX script?? I want to know about the local variables we declare inside the UNIX script. e.g. i=10 OR cat file1 | while read line do echo $line done etc. Does UNIX have any data types Can some one... (1 Reply)
Discussion started by: VENC22
1 Replies

3. Shell Programming and Scripting

Handling blank spaces

Hi, I am trying to replace a specific column values in a csv file with double quotes when I am find embedded spaces with in the fields. Example: SNO,NAME,ZIPCODE,RANK,SEX,ADDRESS 1,Robert,74538,12,34, M,Robert Street, NY 2,Sam,07564,13,M,12 Main Ave, CA 3,Kim, Ed,12345,14,M,123D ,... (1 Reply)
Discussion started by: techmoris
1 Replies

4. Shell Programming and Scripting

Error handling in Unix shell scripting

Hello, I have written a shell script and suppose there is any error in the script. How i can do exception handling in shell script.for example i have below code sqlplus -s <<uid>>/<<pwd>>@<<$ORACLE_SID>> <<EOF > 1_pid1.log set pagesize 0 set feedback off set heading off set linesize 200... (1 Reply)
Discussion started by: rksingh003
1 Replies

5. UNIX for Dummies Questions & Answers

File Handling in UNIX

Hi all, I have a requirement here where I am dealing with a dynamic file. Each record in the file can contain anywhere between 1(min) to 42(max) Reject codes. For example I may have one record in the file having 3 reject codes and another record having 5 reject codes. The reject codes will be... (2 Replies)
Discussion started by: sujainarayan
2 Replies

6. UNIX for Dummies Questions & Answers

handling white spaces with getopt

Hi I'm trying to ensure that I have catered for all situations with my getopt cases. One other situation I want to cover is should the user enter the script without any preceding arguments eg: ./script_eg I need the script to the direct the user to the helpfile I have tried... (3 Replies)
Discussion started by: ladyAnne
3 Replies

7. Shell Programming and Scripting

Handling directory with spaces in for loops

Hi everyone, I have been a big fan here since a couple years (since I started being an admin ...) and finally decided to become a member and help ppl and perhaps being helped Now I have a problem that might interest some of the gurus. I am abig fan of what I call "one liners". I am trying... (2 Replies)
Discussion started by: plmachiavel
2 Replies

8. Shell Programming and Scripting

UNIX file handling issue

I have a huge file semicolon( ; ) separated records are Pipe(|) delimited. e.g abc;def;ghi|jkl;mno;pqr|123;456;789 I need to replace the 50th field(semicolon separated) of each record with 9006. The 50th field can have no value e.g. ;; Can someone help me with the appropriate command. (3 Replies)
Discussion started by: Gurkamal83
3 Replies

9. UNIX for Advanced & Expert Users

File Processing: Handling spaces in a line

Hi All, Iam trying to get a file processed and some lines have spaces...the below is not working Want to remove empty line Want to remove lines that start with # Avoid line with substring WHOA When trying to get the substring from the var also Iam having trouble file is like VAR=VALUE,... (13 Replies)
Discussion started by: baanprog
13 Replies

10. Shell Programming and Scripting

Handling filenames with spaces

I'm trying to handle some files with spaces in their name using "" or \ . Like "file 1" or file\ 1. My current confusion can be expressed by the following shell script: #!/bin/bash touch "file 1" "file 2" echo -n "ls: " ; ls echo --- for file in "file 1" "file 2" ; do echo $file... (9 Replies)
Discussion started by: Ralph
9 Replies
GETFLAGS(8)						      System Manager's Manual						       GETFLAGS(8)

NAME
getflags, usage - command-line parsing for shell scripts SYNOPSIS
getflags $* usage [ progname ] DESCRIPTION
Getflags parses the options in its command-line arguments according to the environment variable $flagfmt. This variable should be a list of comma-separated options. Each option can be a single letter, indicating that it does not take arguments, or a letter followed by the space-separated names of its arguments. Getflags prints an rc(1) script on standard output which initializes the environment variable $flagx for every option mentioned in $flagfmt. If the option is not present on the command-line, the script sets that option's flag vari- able to an empty list. Otherwise, the script sets that option's flag variable with a list containing the option's arguments or, if the option takes no arguments, with the string 1. The script also sets the variable $* to the list of arguments following the options. The final line in the script sets the $status variable, to the empty string on success and to the string usage when there is an error parsing the command line. Usage prints a usage message to standard error. It creates the message using $flagfmt, as described above, $args, which should contain the string to be printed explaining non-option arguments, and $0, the program name (see rc(1)). If run under sh(1), which does not set $0, the program name must be given explicitly on the command line. EXAMPLE
Parse the arguments for leak(1): flagfmt='b,s,f binary,r res,x width' args='name | pid list' if(! ifs=() eval `{getflags $*} || ~ $#* 0){ usage exit usage } SOURCE
/src/cmd/getflags.c /src/cmd/usage.c SEE ALSO
arg(3) GETFLAGS(8)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy