Sponsored Content
Operating Systems OS X (Apple) Help in explaining this echo conundrum. Post 302993851 by Corona688 on Wednesday 15th of March 2017 11:34:32 AM
Old 03-15-2017
Quote:
Originally Posted by wisecracker
Seems consistent with 'sh'.
I am going to have to be careful with this.
Basically, only use echo if you want to print preformatted / unescaped data: Any extended behavior like processing backslashes isn't portable.

Quote:
I do know a few ideas but do not know if this would work in the Solaris situation you quoted.
I don't see any point fighting it when there's better alternatives though. Your solution is twice as complicated and much less efficient than just using printf once to do both jobs.
printf "\033[1mBold Text\033[0m Normal Text\n"

You're not breaking the rules, though Smilie It's completely fine to store any ASCII character besides NULL in a variable.

Last edited by Corona688; 03-15-2017 at 12:45 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

explaining awk

i am new to awk scripting. i couldn't figure out how this awk script works can anyone explain? #!/bin/awk -f { for( x=1; x<=NF; ++x) { if( x == 3 ) { continue } print x, $x } } thank you and regards (1 Reply)
Discussion started by: phone_book
1 Replies

2. UNIX for Dummies Questions & Answers

Need help explaining how to use a VPN on a UNIX server with a Mac OS

I have gotten a gig to teach someone how to use a VPN client for a UNIX server on a MAC os. The problem is I have never used UNIX, dont mess with VPN's (my dad has a VPN that I have used a couple of times). I'm currently taking a crash course on UNIX but I was wondering if anyone could help me with... (0 Replies)
Discussion started by: psycopuppy
0 Replies

3. UNIX for Dummies Questions & Answers

Explaining some lines from files : .login and .cshrc

Hello, can anyone explain me please what do those lines do ? From file .login 1) set history=40 2) setenv MACH `uname -s` 3) source /etc/login 4) source ~/$MACH/.login From file .cshrc 1) if ( ! $?prompt) exit 0 (5 Replies)
Discussion started by: bbqtoss
5 Replies

4. UNIX for Dummies Questions & Answers

umask conundrum

Hi All, i was reading up on a umask question on this forum and have a question on this. the umask value on my home PC running on cygwin is 022. when i create a dir it defaults to permission 755, when i create a file it defaults to 644. Now it starts at 777 for dirs and 666 for files and... (1 Reply)
Discussion started by: Irishboy24
1 Replies

5. Shell Programming and Scripting

Conundrum - Flexible way to strip extension

Hi, First post here. I have something that may prove to be difficult. I have the following files: Example1.0.0.tar.gz Example2.tar Example3.zip Example4.0.0.0.0.0.bzip2 I need to remove the file extensions and store as a variable so they look like this: Example1.0.0 Example2... (3 Replies)
Discussion started by: Spadez
3 Replies

6. Shell Programming and Scripting

sudo scripts conundrum

hello; Got a problem running monitoring scripts using sudo ssh.. Mgmt decided to take away root sudoers access.. so most of the scripts ran as: sudo ssh $BOX ... Now I need to run them as: echo $my_pw | sudo -S -l my_user_id $BOX ... I tried this but not working.. Any wisdom/tricks... (3 Replies)
Discussion started by: delphys
3 Replies

7. Shell Programming and Scripting

Help to explaining a command in run dot tcl

Hi, I'm running a rdt (run dot tcl) command, and come accross this line: alias abc 'set ARGS =(\!*); source home123/abc/$ARGS/setup' What does the command exactly do? Please help. (6 Replies)
Discussion started by: mar85
6 Replies

8. IP Networking

iptables conundrum

Ok, if youre reading this prepare yourself.(debian based os) so im trying to do this routing with ip tables, i need to forward/SNAT traffic from 192.168.111.1 to 10.10.10.250, the 192.x.x.x ips are being shoved into a honeyd like program called inetsim so its offline, 10.10.10.125 is connected... (3 Replies)
Discussion started by: Shocco
3 Replies
page_util_quote(n)					      Parser generator tools						page_util_quote(n)

__________________________________________________________________________________________________________________________________________________

NAME
page_util_quote - page character quoting utilities SYNOPSIS
package require page::util::quote ?0.1? package require snit ::page::util::quote::unquote char ::page::util::quote::quote'tcl char ::page::util::quote::quote'tclstr char ::page::util::quote::quote'tclcom char _________________________________________________________________ DESCRIPTION
This package provides a few utility commands to convert characters into various forms. API
::page::util::quote::unquote char A character, as stored in an abstract syntax tree by a PEG processor (See the packages grammar::peg::interpreter, grammar::me, and their relations), i.e. in some quoted form, is converted into the equivalent Tcl character. The character is returned as the result of the command. ::page::util::quote::quote'tcl char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser, will regenerate the character in question and is 7bit ASCII. The string is returned as the result of this command. ::page::util::quote::quote'tclstr char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser and will generate a human readable representation of the character in question. The string is returned as the result of this command. The string does not use any unprintable characters. It may use backslash-quoting. High UTF characters are quoted to avoid problems with the still prevalent ascii terminals. It is assumed that the string will be used in a double-quoted environment. ::page::util::quote::quote'tclcom char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser when used within a Tcl comment. The string is returned as the result of this command. BUGS, IDEAS, FEEDBACK This document, will undoubtedly contain bugs and other problems. Please report such in the category page of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have. KEYWORDS
page, parser generator, quoting, text processing COPYRIGHT
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net> page 1.0 page_util_quote(n)
All times are GMT -4. The time now is 11:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy