Sponsored Content
Top Forums Shell Programming and Scripting [zenity] string is not displayed Post 303032419 by Peasant on Sunday 17th of March 2019 03:22:46 AM
Old 03-17-2019
You will need to use markup language for this, and escape backslashes multiple times.
Something like this should work :
Code:
chars="\\\\ , /, <, >, ?, |, &, $"
zenity --forms --text="Chars not allowed: $chars" --add-entry="File Name"

Hope that helps
Regards
Peasant
This User Gave Thanks to Peasant For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Zenity

Hi! does someone know how can I setup a zenity entry "box" such that comes with the data as default. like it appears an entry box already with the data but it can be modify. thanks (2 Replies)
Discussion started by: ruben.rodrigues
2 Replies

2. UNIX for Dummies Questions & Answers

zenity --question help

Hello I've a script where I've a zenity --question because I want to ask the user if he is sure that he wants to delete the file. The problem is, if the user says "OK" it deletes nad if the user says cancel it deletes :) How can I close the script if the user says cancel?? thanks (3 Replies)
Discussion started by: ruben.rodrigues
3 Replies

3. Shell Programming and Scripting

Zenity Menu

I have some troubles with zenity and menu. I seach for: MAIN MENU CHOICE 1 "do something" CHOICE 2 "do something 2" CHOICE 3 "do something 3" But then in "do someghing " when i click i want to return to the MAIN MENU So something like: while true; do ... (4 Replies)
Discussion started by: aspire
4 Replies

4. Shell Programming and Scripting

Zenity and IF/ELSE cond'.

Hey guys i wrote this code but it wont give me anything. any ideas? ans=$(zenity --list --text "Do you want to set USER/GROUP quota?" --radiolist --column "Choice" --column "Desc" TRUE Hi FALSE Bye); echo $ans if ; then ./example.sh else exit fi (2 Replies)
Discussion started by: dplate07
2 Replies

5. Shell Programming and Scripting

file zenity

Hello, I have a script with zenity file, but I want to know the file name and path, but this way I just take the name of the file. fl1=`zenity --file-selection --title="Seleccionar fichero"` basename $fl1 .txt > temp nom=`cat temp` Thank you very much (1 Reply)
Discussion started by: uri_crack
1 Replies

6. Shell Programming and Scripting

Highlight the string displayed

Hi, Want to highlight the string displayed on the screen. ften="File selected" FB1="\e From the above code, String "File selected" gets highlighted, but the string in the next line does not get highlighted. I tried using FB1& FB2 variables but didn't worked out may be due to too... (1 Reply)
Discussion started by: milink
1 Replies

7. Linux

Zenity function

i wanted to put this code on a list zenity but it never worsk, how would i be able to do that? cd /home/mint ls -d */ (3 Replies)
Discussion started by: roozis
3 Replies

8. Shell Programming and Scripting

Zenity help

I have a large system housekeeping script, that I want to use with zenity. One of the processes will be to conduct a virus scan, which I can easily do with something like: clamscan -rv / | zenity --text-info --width 640 --height 640 The problem is that it needs user intervention by... (2 Replies)
Discussion started by: stumpyuk
2 Replies

9. Shell Programming and Scripting

Zenity, While, and Conditions

All, I'm having fighting a losing battle with what I though would be simple. My goal is this: Show a zenity progress or info dialog until the system obtains an ip address, then close the dialog and continue through the rest of the script. Right now I've got the following: ip=`ifconfig |... (2 Replies)
Discussion started by: timbrammer91091
2 Replies

10. UNIX for Beginners Questions & Answers

New to Linux, using zenity need some help

Hello all, I am using zenity for my final project in class and need some help. I am trying to create a text based game and in this game you pick up items, I want to store those items in a .txt file and be able to recall them later and remove a SPECIFIC item from the list after it has been... (4 Replies)
Discussion started by: papgizmet
4 Replies
URI::Escape(3)						User Contributed Perl Documentation					    URI::Escape(3)

NAME
URI::Escape - Percent-encode and percent-decode unsafe characters SYNOPSIS
use URI::Escape; $safe = uri_escape("10% is enough "); $verysafe = uri_escape("foo", "-377"); $str = uri_unescape($safe); DESCRIPTION
This module provides functions to percent-encode and percent-decode URI strings as defined by RFC 3986. Percent-encoding URI's is informally called "URI escaping". This is the terminology used by this module, which predates the formalization of the terms by the RFC by several years. A URI consists of a restricted set of characters. The restricted set of characters consists of digits, letters, and a few graphic symbols chosen from those common to most of the character encodings and input facilities available to Internet users. They are made up of the "unreserved" and "reserved" character sets as defined in RFC 3986. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" reserved = ":" / "/" / "?" / "#" / "[" / "]" / "@" "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" In addition, any byte (octet) can be represented in a URI by an escape sequence: a triplet consisting of the character "%" followed by two hexadecimal digits. A byte can also be represented directly by a character, using the US-ASCII character for that octet. Some of the characters are reserved for use as delimiters or as part of certain URI components. These must be escaped if they are to be treated as ordinary data. Read RFC 3986 for further details. The functions provided (and exported by default) from this module are: uri_escape( $string ) uri_escape( $string, $unsafe ) Replaces each unsafe character in the $string with the corresponding escape sequence and returns the result. The $string argument should be a string of bytes. The uri_escape() function will croak if given a characters with code above 255. Use uri_escape_utf8() if you know you have such chars or/and want chars in the 128 .. 255 range treated as UTF-8. The uri_escape() function takes an optional second argument that overrides the set of characters that are to be escaped. The set is specified as a string that can be used in a regular expression character class (between [ ]). E.g.: "x00-x1fx7f-xff" # all control and hi-bit characters "a-z" # all lower case characters "^A-Za-z" # everything not a letter The default set of characters to be escaped is all those which are not part of the "unreserved" character class shown above as well as the reserved characters. I.e. the default is: "^A-Za-z0-9-._~" uri_escape_utf8( $string ) uri_escape_utf8( $string, $unsafe ) Works like uri_escape(), but will encode chars as UTF-8 before escaping them. This makes this function able to deal with characters with code above 255 in $string. Note that chars in the 128 .. 255 range will be escaped differently by this function compared to what uri_escape() would. For chars in the 0 .. 127 range there is no difference. Equivalent to: utf8::encode($string); my $uri = uri_escape($string); Note: JavaScript has a function called escape() that produces the sequence "%uXXXX" for chars in the 256 .. 65535 range. This function has really nothing to do with URI escaping but some folks got confused since it "does the right thing" in the 0 .. 255 range. Because of this you sometimes see "URIs" with these kind of escapes. The JavaScript encodeURIComponent() function is similar to uri_escape_utf8(). uri_unescape($string,...) Returns a string with each %XX sequence replaced with the actual byte (octet). This does the same as: $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; but does not modify the string in-place as this RE would. Using the uri_unescape() function instead of the RE might make the code look cleaner and is a few characters less to type. In a simple benchmark test I did, calling the function (instead of the inline RE above) if a few chars were unescaped was something like 40% slower, and something like 700% slower if none were. If you are going to unescape a lot of times it might be a good idea to inline the RE. If the uri_unescape() function is passed multiple strings, then each one is returned unescaped. The module can also export the %escapes hash, which contains the mapping from all 256 bytes to the corresponding escape codes. Lookup in this hash is faster than evaluating "sprintf("%%%02X", ord($byte))" each time. SEE ALSO
URI COPYRIGHT
Copyright 1995-2004 Gisle Aas. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2012-02-11 URI::Escape(3)
All times are GMT -4. The time now is 07:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy