Mailing List Archive


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

Re: [tlug] Shell Basics: Dealing With Filenames And Arguments With Spaces (was Re: Representing a Space in a Path)



On Wed, 14 Jan 2015 17:02:36 +0100, Bruno Raoult <braoult@example.com> wrote:

> On Wed, Jan 14, 2015 at 4:24 PM, <jep200404@example.com> wrote:

> > By the way, study $* versus "$@".

> Even these are difficult...  Trying to pass a variable to a subshell I mean.

Please show a minimal example that demonstrates the problem.

[test@tlug br]$ cat a\ subshell 
#!/bin/sh
for arg in "$@"; do
    echo "'$arg'"
done
[test@tlug br]$ bash "a subshell" 'yet another subshell' "hello world" foo bar
'yet another subshell'
'hello world'
'foo'
'bar'
[test@tlug br]$ 


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links