[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

i want HARD SPACES for dealing with function passing...

From: stig
Subject: i want HARD SPACES for dealing with function passing...
Date: 21 Aug 2001 01:41:53 -0000

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 -m486 
uname output: Linux jato.hackvan.com 2.2.16-3 #1 Mon Jun 19 19:11:44 EDT 2000 
i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 21
Release Status: release


it's hell dealing with filenames with embedded spaces.  if you're trying to 
pass them in and out of functions.  this is incredibly common if you save files 
via samba from windows where spaces are common.


touch foo\ bar
passargs() { echo "$@"; }
ls $(passargs foo\ bar)



new variable HS (default = \177) for hardspace character
set option 'hs' to enable automatic [un]mangling (default to yes)

1.  upon initial command-line parsing, convert "foo bar" to "foo${HS}bar"
    unmangle upon command external execution

2.  expand "$@" with $HS replacing all internal spaces.
3.  allow return to take string args (work like echo, but returns multiple args 
instead of a string parsed by IFS)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]