- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unespected "%97" as output
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2011 08:09 AM
02-11-2011 08:09 AM
It works correctly for a lot of code but it have some problems on the codes that contain the space caracter.
This script execute a java program that cript my code.
I launch the script eith the following command:
....
Var2="ABCD XY"
/opt/java6/bin/java CriptProgr "${Var2}"
....
If I run the script I get an output like this
asdf%97oe
If I run the command by command line
Example:
# /opt/java6/bin/java CriptProgr "ABCD XY"
asdf oe
#
The second result is what I need.
But I need to have this resylt running a script and I didn't understand why I have "%97" in the result.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2011 02:40 AM
02-12-2011 02:40 AM
Re: Unespected "%97" as output
Check the environment variables from the command line and compare them with what your script uses.
That would probably highlight some
differences (like TERM, LANG or other
variables).
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2011 02:50 AM
02-12-2011 02:50 AM
Re: Unespected "%97" as output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 03:11 AM
02-14-2011 03:11 AM
Re: Unespected "%97" as output
what does it means "%97" character?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 03:36 AM
02-14-2011 03:36 AM
Re: Unespected "%97" as output
It looks like your Java program is interpreting the space as a separation of parsed fields. The use of double quotes in the definition of script-level variables behave different from command prompt. Try this inside your script:
Var2="\"ABCD XY\""
By this way we try to force to always have double quotes inside the variable Var2.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 03:43 AM
02-14-2011 03:43 AM
Re: Unespected "%97" as output
I've seen that in HTML as an escape for hex 97.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 03:45 AM
02-14-2011 03:45 AM
Re: Unespected "%97" as output
I bypassed the problem using sed.
opt/java6/bin/java CriptProgr "${Var2}" | sed 's/%97/ /g'
But I still didn't understand why on command line I have a result as output and I have a different result if I run it inside the script.
Another things that I would like to understand is why "%97" appear inside the output and what it means.
Regards,
BG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 03:55 AM
02-14-2011 03:55 AM
Re: Unespected "%97" as output
I guess that %97 code is not produced by your script, it is an output from Java execution.
Try execute this from your promt to check if obtains the same script behavior:
#/opt/java6/bin/java CriptProgr ABCD XY
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 04:15 AM
02-14-2011 04:15 AM
Re: Unespected "%97" as output
CodeTest="${Var2}"
echo "CodeTest=${CodeTest}" >> ${LogFile}
If I look the output in ${LogFile} i can read the following output:
CodeTest=asdf%20oe
If I did the same thing with double quote:
CodeTest="\"${Var2}\""
echo "CodeTest=${CodeTest}" >> ${LogFile}
output:
CodeTest="asdf%20oe"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 04:23 AM
02-14-2011 04:23 AM
Re: Unespected "%97" as output
Could you show us the script content?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 04:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 05:03 AM
02-14-2011 05:03 AM
Re: Unespected "%97" as output
:ABCD%20XY:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 05:05 AM
02-14-2011 05:05 AM
Re: Unespected "%97" as output
output in LogFile:
...
:ABCD%20XY:
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 05:26 AM
02-14-2011 05:26 AM
Re: Unespected "%97" as output
This bogus %20 is why you get that %97. So where do you set Var2? From some web page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011 06:10 AM
02-14-2011 06:10 AM
Re: Unespected "%97" as output
The application launch the following command:
ScriptName.sh "ABCD%20XY"
I used sed to clean the %20.
I checked and %97 is the result of:
opt/java6/bin/java CriptProgr "%20"
regards
BG