Echo command ASCII characters-batch scripting

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2008
Posts: 49
Reputation: gsingh2011 is an unknown quantity at this point 
Solved Threads: 0
gsingh2011 gsingh2011 is offline Offline
Light Poster

Echo command ASCII characters-batch scripting

 
0
  #1
Jan 10th, 2009
Does anyone know if its possible to type in a number and get the resulting ASCII characters in a batch file? I think in Unix based machines you type the command then \042 or whatever number you want, but I don't know if you can do it in batch files...
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2,039
Reputation: Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of 
Solved Threads: 177
Aia's Avatar
Aia Aia is offline Offline
Postaholic

Re: Echo command ASCII characters-batch scripting

 
0
  #2
Jan 10th, 2009
If your echo accept the -e it would be like:
  1. echo -e "\101"
Otherwise use printf
  1. printf "%b\n" "\0101"
Last edited by Aia; Jan 10th, 2009 at 1:53 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 49
Reputation: gsingh2011 is an unknown quantity at this point 
Solved Threads: 0
gsingh2011 gsingh2011 is offline Offline
Light Poster

Re: Echo command ASCII characters-batch scripting

 
0
  #3
Jan 10th, 2009
Nope, that only works for bash not batch. Any other ideas?

If there isnt a way, is there a way to define them? Like have a defined as 01 so every time you use 01 it would use a in its place. I don't want to do 26 if statements for the alphabet, or 52 if I make it case sensitive, and adding symbols would be hell, so if I could make definitions some how that would be great.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Echo command ASCII characters-batch scripting

 
0
  #4
Jan 10th, 2009
*Looks Around*
Batch Files Isn't Linux and Unix Shell Scripting.....

No, This isn't possible with command.com / cmd.exe alone (Batch). In order to do it, you will need a special exe of some kind. Easy enough to write one.
Last edited by Comatose; Jan 10th, 2009 at 7:58 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC