How to replace one char to get many strings in Shell?
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I can find many questions with answers in the other direction, but unfortunately not in the one I would like to have my replacements: I intend to replace a char, such as #
, in a string, such as test#asdf
, with a sequence, such as 0..10
to get a sequence of strings, in this example test0asdf test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf
.
I tried, from others:
echo '_#.test' | tr # 0..10
(throws usage)echo '_#.test' | sed -r 's/#/0..10/g'
(returns_0..10.test
)echo '_#.test' | sed -r 's/#/'0..10'/g'
(works for the first, afterwards I getsed: can't read (...) no such file or directory
)
What is a working approach to this problem?
Edit, as I may not comment yet: I have to use #
in the string, in which this character should be replaced, as the string passed from another program. I could first replace it with another char though.
bash shell-script sed
add a comment |Â
up vote
5
down vote
favorite
I can find many questions with answers in the other direction, but unfortunately not in the one I would like to have my replacements: I intend to replace a char, such as #
, in a string, such as test#asdf
, with a sequence, such as 0..10
to get a sequence of strings, in this example test0asdf test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf
.
I tried, from others:
echo '_#.test' | tr # 0..10
(throws usage)echo '_#.test' | sed -r 's/#/0..10/g'
(returns_0..10.test
)echo '_#.test' | sed -r 's/#/'0..10'/g'
(works for the first, afterwards I getsed: can't read (...) no such file or directory
)
What is a working approach to this problem?
Edit, as I may not comment yet: I have to use #
in the string, in which this character should be replaced, as the string passed from another program. I could first replace it with another char though.
bash shell-script sed
Why not justecho _0..10.test
? The way you have it, it's echoing the string first and then replacing the character which isn't going to work. You could also replace the character and thenecho
.
– Nasir Riley
Aug 27 at 19:02
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I can find many questions with answers in the other direction, but unfortunately not in the one I would like to have my replacements: I intend to replace a char, such as #
, in a string, such as test#asdf
, with a sequence, such as 0..10
to get a sequence of strings, in this example test0asdf test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf
.
I tried, from others:
echo '_#.test' | tr # 0..10
(throws usage)echo '_#.test' | sed -r 's/#/0..10/g'
(returns_0..10.test
)echo '_#.test' | sed -r 's/#/'0..10'/g'
(works for the first, afterwards I getsed: can't read (...) no such file or directory
)
What is a working approach to this problem?
Edit, as I may not comment yet: I have to use #
in the string, in which this character should be replaced, as the string passed from another program. I could first replace it with another char though.
bash shell-script sed
I can find many questions with answers in the other direction, but unfortunately not in the one I would like to have my replacements: I intend to replace a char, such as #
, in a string, such as test#asdf
, with a sequence, such as 0..10
to get a sequence of strings, in this example test0asdf test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf
.
I tried, from others:
echo '_#.test' | tr # 0..10
(throws usage)echo '_#.test' | sed -r 's/#/0..10/g'
(returns_0..10.test
)echo '_#.test' | sed -r 's/#/'0..10'/g'
(works for the first, afterwards I getsed: can't read (...) no such file or directory
)
What is a working approach to this problem?
Edit, as I may not comment yet: I have to use #
in the string, in which this character should be replaced, as the string passed from another program. I could first replace it with another char though.
bash shell-script sed
edited Aug 27 at 18:31
asked Aug 27 at 18:18


BernhardWebstudio
284
284
Why not justecho _0..10.test
? The way you have it, it's echoing the string first and then replacing the character which isn't going to work. You could also replace the character and thenecho
.
– Nasir Riley
Aug 27 at 19:02
add a comment |Â
Why not justecho _0..10.test
? The way you have it, it's echoing the string first and then replacing the character which isn't going to work. You could also replace the character and thenecho
.
– Nasir Riley
Aug 27 at 19:02
Why not just
echo _0..10.test
? The way you have it, it's echoing the string first and then replacing the character which isn't going to work. You could also replace the character and then echo
.– Nasir Riley
Aug 27 at 19:02
Why not just
echo _0..10.test
? The way you have it, it's echoing the string first and then replacing the character which isn't going to work. You could also replace the character and then echo
.– Nasir Riley
Aug 27 at 19:02
add a comment |Â
6 Answers
6
active
oldest
votes
up vote
6
down vote
accepted
The 0..10
zsh
operator (now also supported by a few other shells including bash
) is just another form of csh
-style brace expansion.
It is expanded by the shell before calling the command. The command doesn't see those 0..10
.
With tr '#' 0..10
(quoting that #
as otherwise it's parsed by the shell as the start of a comment), tr
ends being called with ("tr", "#", "0", "1", ..., "10") as arguments and tr
doesn't expect that many arguments.
Here, you'd want:
echo '_'0..10'.test'
for echo
to be passed "_0.test", "_1.test", ..., "_10.test" as arguments.
Or if you wanted that #
to be translated into that 0..10
operator, transform it into shell code to be evaluated:
eval "$(echo 'echo _#.test' | sed 's/#/0..10/')"
where eval
is being passed echo _0..10.test
as arguments.
(not that I would recommend doing anything like that).
add a comment |Â
up vote
6
down vote
You can split the string on the delimiter, capture the prefix and the suffix, then use brace expansion to generate the names:
str='test#asdf'
IFS='#' read -r prefix suffix <<<"$str"
names=( "$prefix"0..10"$suffix" )
declare -p names
declare -a names='([0]="test0asdf" [1]="test1asdf" [2]="test2asdf" [3]="test3asdf" [4]="test4asdf" [5]="test5asdf" [6]="test6asdf" [7]="test7asdf" [8]="test8asdf" [9]="test9asdf" [10]="test10asdf")'
add a comment |Â
up vote
2
down vote
Do you have to use #
? Maybe you could use %d
?
$ for i in 1..10; do printf "_%d.test " "$i"; done
_1.test _2.test _3.test _4.test _5.test _6.test _7.test _8.test _9.test _10.test
add a comment |Â
up vote
2
down vote
First #
starts a comment. So, you need to escape it with .
Second, use a for
loop.
Here is your solution:
for i in 1..10
do
echo '_#.test' | tr # $i
done
tr
unfortunately does not work for more than one character, such as when you want to substitute #
with 10
. You are better off using sed
for that reason.
for i in 1..10
do
echo '_#.test' | sed "s/#/$i/"
done
1
What about the "10" result?
– RudiC
Aug 28 at 8:02
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
add a comment |Â
up vote
1
down vote
I would do it with parameter expansion:
$ var='test#asdf'
$ for i in 1..10; do echo "$var/#/"$i""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
The $parameter/pattern/string
expansion
- takes the expansion of
$parameter
(in our case,$var
) and - replaces the first occurrence of
pattern
(the escaped#
–/#
has a special meaning in the context, "replace at the beginning of the string", which we want to avoid) with string
("$i"
in our case)
Alternatively, you could replace the #
with %d
and use it as the format string for printf
:
printf "$var/#/%d\n" 1..10
add a comment |Â
up vote
0
down vote
If what you need is a string expansion, then this is enough:
echo 'test'1..11'asdf'
test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf test11asdf
If you need to replace a #
in several strings, you may use the positional arguments:
$ set -- test#asdf,,,,,,,,,,
$ printf '%s ' "$@"; echo
test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf
$ j=0; for i do echo "$i//#/"$((j+=1))""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
test11asdf
add a comment |Â
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
The 0..10
zsh
operator (now also supported by a few other shells including bash
) is just another form of csh
-style brace expansion.
It is expanded by the shell before calling the command. The command doesn't see those 0..10
.
With tr '#' 0..10
(quoting that #
as otherwise it's parsed by the shell as the start of a comment), tr
ends being called with ("tr", "#", "0", "1", ..., "10") as arguments and tr
doesn't expect that many arguments.
Here, you'd want:
echo '_'0..10'.test'
for echo
to be passed "_0.test", "_1.test", ..., "_10.test" as arguments.
Or if you wanted that #
to be translated into that 0..10
operator, transform it into shell code to be evaluated:
eval "$(echo 'echo _#.test' | sed 's/#/0..10/')"
where eval
is being passed echo _0..10.test
as arguments.
(not that I would recommend doing anything like that).
add a comment |Â
up vote
6
down vote
accepted
The 0..10
zsh
operator (now also supported by a few other shells including bash
) is just another form of csh
-style brace expansion.
It is expanded by the shell before calling the command. The command doesn't see those 0..10
.
With tr '#' 0..10
(quoting that #
as otherwise it's parsed by the shell as the start of a comment), tr
ends being called with ("tr", "#", "0", "1", ..., "10") as arguments and tr
doesn't expect that many arguments.
Here, you'd want:
echo '_'0..10'.test'
for echo
to be passed "_0.test", "_1.test", ..., "_10.test" as arguments.
Or if you wanted that #
to be translated into that 0..10
operator, transform it into shell code to be evaluated:
eval "$(echo 'echo _#.test' | sed 's/#/0..10/')"
where eval
is being passed echo _0..10.test
as arguments.
(not that I would recommend doing anything like that).
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
The 0..10
zsh
operator (now also supported by a few other shells including bash
) is just another form of csh
-style brace expansion.
It is expanded by the shell before calling the command. The command doesn't see those 0..10
.
With tr '#' 0..10
(quoting that #
as otherwise it's parsed by the shell as the start of a comment), tr
ends being called with ("tr", "#", "0", "1", ..., "10") as arguments and tr
doesn't expect that many arguments.
Here, you'd want:
echo '_'0..10'.test'
for echo
to be passed "_0.test", "_1.test", ..., "_10.test" as arguments.
Or if you wanted that #
to be translated into that 0..10
operator, transform it into shell code to be evaluated:
eval "$(echo 'echo _#.test' | sed 's/#/0..10/')"
where eval
is being passed echo _0..10.test
as arguments.
(not that I would recommend doing anything like that).
The 0..10
zsh
operator (now also supported by a few other shells including bash
) is just another form of csh
-style brace expansion.
It is expanded by the shell before calling the command. The command doesn't see those 0..10
.
With tr '#' 0..10
(quoting that #
as otherwise it's parsed by the shell as the start of a comment), tr
ends being called with ("tr", "#", "0", "1", ..., "10") as arguments and tr
doesn't expect that many arguments.
Here, you'd want:
echo '_'0..10'.test'
for echo
to be passed "_0.test", "_1.test", ..., "_10.test" as arguments.
Or if you wanted that #
to be translated into that 0..10
operator, transform it into shell code to be evaluated:
eval "$(echo 'echo _#.test' | sed 's/#/0..10/')"
where eval
is being passed echo _0..10.test
as arguments.
(not that I would recommend doing anything like that).
edited Aug 27 at 19:24
answered Aug 27 at 18:32


Stéphane Chazelas
283k53521855
283k53521855
add a comment |Â
add a comment |Â
up vote
6
down vote
You can split the string on the delimiter, capture the prefix and the suffix, then use brace expansion to generate the names:
str='test#asdf'
IFS='#' read -r prefix suffix <<<"$str"
names=( "$prefix"0..10"$suffix" )
declare -p names
declare -a names='([0]="test0asdf" [1]="test1asdf" [2]="test2asdf" [3]="test3asdf" [4]="test4asdf" [5]="test5asdf" [6]="test6asdf" [7]="test7asdf" [8]="test8asdf" [9]="test9asdf" [10]="test10asdf")'
add a comment |Â
up vote
6
down vote
You can split the string on the delimiter, capture the prefix and the suffix, then use brace expansion to generate the names:
str='test#asdf'
IFS='#' read -r prefix suffix <<<"$str"
names=( "$prefix"0..10"$suffix" )
declare -p names
declare -a names='([0]="test0asdf" [1]="test1asdf" [2]="test2asdf" [3]="test3asdf" [4]="test4asdf" [5]="test5asdf" [6]="test6asdf" [7]="test7asdf" [8]="test8asdf" [9]="test9asdf" [10]="test10asdf")'
add a comment |Â
up vote
6
down vote
up vote
6
down vote
You can split the string on the delimiter, capture the prefix and the suffix, then use brace expansion to generate the names:
str='test#asdf'
IFS='#' read -r prefix suffix <<<"$str"
names=( "$prefix"0..10"$suffix" )
declare -p names
declare -a names='([0]="test0asdf" [1]="test1asdf" [2]="test2asdf" [3]="test3asdf" [4]="test4asdf" [5]="test5asdf" [6]="test6asdf" [7]="test7asdf" [8]="test8asdf" [9]="test9asdf" [10]="test10asdf")'
You can split the string on the delimiter, capture the prefix and the suffix, then use brace expansion to generate the names:
str='test#asdf'
IFS='#' read -r prefix suffix <<<"$str"
names=( "$prefix"0..10"$suffix" )
declare -p names
declare -a names='([0]="test0asdf" [1]="test1asdf" [2]="test2asdf" [3]="test3asdf" [4]="test4asdf" [5]="test5asdf" [6]="test6asdf" [7]="test7asdf" [8]="test8asdf" [9]="test9asdf" [10]="test10asdf")'
edited Aug 27 at 20:42
answered Aug 27 at 19:07
glenn jackman
47k265103
47k265103
add a comment |Â
add a comment |Â
up vote
2
down vote
Do you have to use #
? Maybe you could use %d
?
$ for i in 1..10; do printf "_%d.test " "$i"; done
_1.test _2.test _3.test _4.test _5.test _6.test _7.test _8.test _9.test _10.test
add a comment |Â
up vote
2
down vote
Do you have to use #
? Maybe you could use %d
?
$ for i in 1..10; do printf "_%d.test " "$i"; done
_1.test _2.test _3.test _4.test _5.test _6.test _7.test _8.test _9.test _10.test
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Do you have to use #
? Maybe you could use %d
?
$ for i in 1..10; do printf "_%d.test " "$i"; done
_1.test _2.test _3.test _4.test _5.test _6.test _7.test _8.test _9.test _10.test
Do you have to use #
? Maybe you could use %d
?
$ for i in 1..10; do printf "_%d.test " "$i"; done
_1.test _2.test _3.test _4.test _5.test _6.test _7.test _8.test _9.test _10.test
answered Aug 27 at 18:29
DopeGhoti
40.7k54979
40.7k54979
add a comment |Â
add a comment |Â
up vote
2
down vote
First #
starts a comment. So, you need to escape it with .
Second, use a for
loop.
Here is your solution:
for i in 1..10
do
echo '_#.test' | tr # $i
done
tr
unfortunately does not work for more than one character, such as when you want to substitute #
with 10
. You are better off using sed
for that reason.
for i in 1..10
do
echo '_#.test' | sed "s/#/$i/"
done
1
What about the "10" result?
– RudiC
Aug 28 at 8:02
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
add a comment |Â
up vote
2
down vote
First #
starts a comment. So, you need to escape it with .
Second, use a for
loop.
Here is your solution:
for i in 1..10
do
echo '_#.test' | tr # $i
done
tr
unfortunately does not work for more than one character, such as when you want to substitute #
with 10
. You are better off using sed
for that reason.
for i in 1..10
do
echo '_#.test' | sed "s/#/$i/"
done
1
What about the "10" result?
– RudiC
Aug 28 at 8:02
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
add a comment |Â
up vote
2
down vote
up vote
2
down vote
First #
starts a comment. So, you need to escape it with .
Second, use a for
loop.
Here is your solution:
for i in 1..10
do
echo '_#.test' | tr # $i
done
tr
unfortunately does not work for more than one character, such as when you want to substitute #
with 10
. You are better off using sed
for that reason.
for i in 1..10
do
echo '_#.test' | sed "s/#/$i/"
done
First #
starts a comment. So, you need to escape it with .
Second, use a for
loop.
Here is your solution:
for i in 1..10
do
echo '_#.test' | tr # $i
done
tr
unfortunately does not work for more than one character, such as when you want to substitute #
with 10
. You are better off using sed
for that reason.
for i in 1..10
do
echo '_#.test' | sed "s/#/$i/"
done
edited Aug 28 at 13:13
answered Aug 27 at 18:26
unxnut
3,3802918
3,3802918
1
What about the "10" result?
– RudiC
Aug 28 at 8:02
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
add a comment |Â
1
What about the "10" result?
– RudiC
Aug 28 at 8:02
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
1
1
What about the "10" result?
– RudiC
Aug 28 at 8:02
What about the "10" result?
– RudiC
Aug 28 at 8:02
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
Thanks @RudiC. Fixed my answer.
– unxnut
Aug 28 at 13:13
add a comment |Â
up vote
1
down vote
I would do it with parameter expansion:
$ var='test#asdf'
$ for i in 1..10; do echo "$var/#/"$i""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
The $parameter/pattern/string
expansion
- takes the expansion of
$parameter
(in our case,$var
) and - replaces the first occurrence of
pattern
(the escaped#
–/#
has a special meaning in the context, "replace at the beginning of the string", which we want to avoid) with string
("$i"
in our case)
Alternatively, you could replace the #
with %d
and use it as the format string for printf
:
printf "$var/#/%d\n" 1..10
add a comment |Â
up vote
1
down vote
I would do it with parameter expansion:
$ var='test#asdf'
$ for i in 1..10; do echo "$var/#/"$i""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
The $parameter/pattern/string
expansion
- takes the expansion of
$parameter
(in our case,$var
) and - replaces the first occurrence of
pattern
(the escaped#
–/#
has a special meaning in the context, "replace at the beginning of the string", which we want to avoid) with string
("$i"
in our case)
Alternatively, you could replace the #
with %d
and use it as the format string for printf
:
printf "$var/#/%d\n" 1..10
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I would do it with parameter expansion:
$ var='test#asdf'
$ for i in 1..10; do echo "$var/#/"$i""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
The $parameter/pattern/string
expansion
- takes the expansion of
$parameter
(in our case,$var
) and - replaces the first occurrence of
pattern
(the escaped#
–/#
has a special meaning in the context, "replace at the beginning of the string", which we want to avoid) with string
("$i"
in our case)
Alternatively, you could replace the #
with %d
and use it as the format string for printf
:
printf "$var/#/%d\n" 1..10
I would do it with parameter expansion:
$ var='test#asdf'
$ for i in 1..10; do echo "$var/#/"$i""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
The $parameter/pattern/string
expansion
- takes the expansion of
$parameter
(in our case,$var
) and - replaces the first occurrence of
pattern
(the escaped#
–/#
has a special meaning in the context, "replace at the beginning of the string", which we want to avoid) with string
("$i"
in our case)
Alternatively, you could replace the #
with %d
and use it as the format string for printf
:
printf "$var/#/%d\n" 1..10
answered Aug 27 at 18:52


Benjamin W.
363110
363110
add a comment |Â
add a comment |Â
up vote
0
down vote
If what you need is a string expansion, then this is enough:
echo 'test'1..11'asdf'
test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf test11asdf
If you need to replace a #
in several strings, you may use the positional arguments:
$ set -- test#asdf,,,,,,,,,,
$ printf '%s ' "$@"; echo
test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf
$ j=0; for i do echo "$i//#/"$((j+=1))""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
test11asdf
add a comment |Â
up vote
0
down vote
If what you need is a string expansion, then this is enough:
echo 'test'1..11'asdf'
test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf test11asdf
If you need to replace a #
in several strings, you may use the positional arguments:
$ set -- test#asdf,,,,,,,,,,
$ printf '%s ' "$@"; echo
test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf
$ j=0; for i do echo "$i//#/"$((j+=1))""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
test11asdf
add a comment |Â
up vote
0
down vote
up vote
0
down vote
If what you need is a string expansion, then this is enough:
echo 'test'1..11'asdf'
test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf test11asdf
If you need to replace a #
in several strings, you may use the positional arguments:
$ set -- test#asdf,,,,,,,,,,
$ printf '%s ' "$@"; echo
test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf
$ j=0; for i do echo "$i//#/"$((j+=1))""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
test11asdf
If what you need is a string expansion, then this is enough:
echo 'test'1..11'asdf'
test1asdf test2asdf test3asdf test4asdf test5asdf test6asdf test7asdf test8asdf test9asdf test10asdf test11asdf
If you need to replace a #
in several strings, you may use the positional arguments:
$ set -- test#asdf,,,,,,,,,,
$ printf '%s ' "$@"; echo
test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf test#asdf
$ j=0; for i do echo "$i//#/"$((j+=1))""; done
test1asdf
test2asdf
test3asdf
test4asdf
test5asdf
test6asdf
test7asdf
test8asdf
test9asdf
test10asdf
test11asdf
answered Aug 27 at 22:58


Isaac
6,8001834
6,8001834
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f465136%2fhow-to-replace-one-char-to-get-many-strings-in-shell%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Why not just
echo _0..10.test
? The way you have it, it's echoing the string first and then replacing the character which isn't going to work. You could also replace the character and thenecho
.– Nasir Riley
Aug 27 at 19:02