A bash loop to echo all possible ASCII characters [closed]
up vote
-3
down vote
favorite
I know how to print all letters
a..z and A..Z and 0..9
But is there a way to print all possible ASCII Characters via a bash loop?
linux bash gnome-terminal
closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-3
down vote
favorite
I know how to print all letters
a..z and A..Z and 0..9
But is there a way to print all possible ASCII Characters via a bash loop?
linux bash gnome-terminal
closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
2
Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54
1
Tryman ascii
– Mark Setchell
Nov 10 at 10:05
1
See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08
I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11
add a comment |
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I know how to print all letters
a..z and A..Z and 0..9
But is there a way to print all possible ASCII Characters via a bash loop?
linux bash gnome-terminal
I know how to print all letters
a..z and A..Z and 0..9
But is there a way to print all possible ASCII Characters via a bash loop?
linux bash gnome-terminal
linux bash gnome-terminal
asked Nov 10 at 8:44
Gautham Varma Kanumuru
11
11
closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
2
Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54
1
Tryman ascii
– Mark Setchell
Nov 10 at 10:05
1
See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08
I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11
add a comment |
2
Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54
1
Tryman ascii
– Mark Setchell
Nov 10 at 10:05
1
See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08
I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11
2
2
Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54
Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54
1
1
Try
man ascii
– Mark Setchell
Nov 10 at 10:05
Try
man ascii
– Mark Setchell
Nov 10 at 10:05
1
1
See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08
See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08
I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11
I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11
add a comment |
3 Answers
3
active
oldest
votes
up vote
2
down vote
You don't need a loop
echo -e \x0..70..9,A..F
It prints all chars from 0 to 127.
add a comment |
up vote
2
down vote
If it is okay to use awk
:
awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'
Or using printf
:
for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done
add a comment |
up vote
1
down vote
use this:
for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
You don't need a loop
echo -e \x0..70..9,A..F
It prints all chars from 0 to 127.
add a comment |
up vote
2
down vote
You don't need a loop
echo -e \x0..70..9,A..F
It prints all chars from 0 to 127.
add a comment |
up vote
2
down vote
up vote
2
down vote
You don't need a loop
echo -e \x0..70..9,A..F
It prints all chars from 0 to 127.
You don't need a loop
echo -e \x0..70..9,A..F
It prints all chars from 0 to 127.
edited Nov 23 at 6:25
answered Nov 10 at 11:24
oguzismail
2,5642821
2,5642821
add a comment |
add a comment |
up vote
2
down vote
If it is okay to use awk
:
awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'
Or using printf
:
for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done
add a comment |
up vote
2
down vote
If it is okay to use awk
:
awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'
Or using printf
:
for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done
add a comment |
up vote
2
down vote
up vote
2
down vote
If it is okay to use awk
:
awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'
Or using printf
:
for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done
If it is okay to use awk
:
awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'
Or using printf
:
for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done
edited Nov 30 at 9:52
answered Nov 10 at 9:27
ssemilla
2,687423
2,687423
add a comment |
add a comment |
up vote
1
down vote
use this:
for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"
add a comment |
up vote
1
down vote
use this:
for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"
add a comment |
up vote
1
down vote
up vote
1
down vote
use this:
for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"
use this:
for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"
answered Nov 10 at 9:10
mahradbt
1389
1389
add a comment |
add a comment |
2
Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54
1
Try
man ascii
– Mark Setchell
Nov 10 at 10:05
1
See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08
I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11