That's pretty much the copy+paste answer, but it's in bash syntax, which may or may not work for you.
In general, ANSI codes starting with esc [ and ending with m after some numbers work well, but they're not portable to all terminals. A (slightly) more portable solution would be to use tput
See the tput manual page for more information.
Perhaps you will find that the codes output by tput are exactly equivalent to the hard-coded escape codes given above. In theory, tput should be portable to terminals which do not speak ANSI, but I don't know of a real-world situation where this would make an enormous difference.
(The code \033 is octal for the escape character.)
Hi guy,
I have a problem to pass a variable containing '*' value to FIND command.
below is the script. It doesn't work by submit below command:
rmf.sh name '*.txt'
or
rmf.sh name *.txt
I've tried either optn="-name '$2'" or optn="-name $2"., and there is no luck.
### (script... (5 Replies)
I have a string of commands I am piping some data through and I want to allow command line switches to select which commands are used. I want to do something like this: OPTION="| command3"
command1 -a -b c.txt | command2 -d -e $OPTION >result.txt
I want to do it that way because OPTION may be... (1 Reply)
Hello:
Any bash PS1 gurus in the house?
I have a custom 2-line prompt and it displays fine, but there is an occasional anomaly.
The backspace key sometimes takes out the 2nd line.
Here's the relevant ~/.bashrc code:
MKF='This is my Kung-Fu'
DOS='C:${PWD//\//\\\}>'
PS1="\$MKF\n\\"
... (0 Replies)
Hi all,
I am new to Linux/shell scripting having moderate knowledge.
In my script, I need to get execution time of a command (say 'ls') in mili seconds level. For this i tried using "time" command to retrieve the total execution time in milli seconds. But, the problem is that, how to save... (9 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
I have a snippet like below.
Based on variable i, i wish to print 1,2,3,4,5th columns to Sample files.
For each loop, one column from contetn and results will be pused to sample files. But i have a problem here
i=1
while ; do
`awk -F"\t" '{print $($i)}' $content > Sample_${i}_original`;... (4 Replies)
Hello All,
I have a bash script and in it at some point I call an Expect Script that does some stuff and saves its
output in a ".txt" file.
Example "/path/to/my/file/Expect_Output.txt" file: notice the 2nd line is empty in the file...
Data for Host-1 (192.168.1.110)
Checking the... (2 Replies)
I'm posting here as it didn't seem quite right in the hardware section (as it's LOM commands). My apologies if I have that wrong though :)
I've finally gotten round to configuring the LOM on my Netra X1, but I can't get it to change the hostname via the "set" command:
lom>show hostname... (2 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello, there!
I am trying to pass an awk variable into a shell command in order to collect the result into an awk variable; in Bash it does work, as in:
v='2'; date -d "now + $v weeks"
But in awk it does not, as in:
v="2"
"date -d 'now + v weeks'" | getline newdate
close ("date -d 'now... (3 Replies)
Discussion started by: fbird3
3 Replies
LEARN ABOUT MOJAVE
reject
cupsaccept(8) Apple Inc. cupsaccept(8)NAME
cupsaccept/cupsreject - accept/reject jobs sent to a destination
SYNOPSIS
cupsaccept [ -E ] [ -U username ] [ -h hostname[:port] ] destination(s)
cupsreject [ -E ] [ -U username ] [ -h hostname[:port] ] [ -r reason ] destination(s)
DESCRIPTION
The cupsaccept command instructs the printing system to accept print jobs to the specified destinations.
The cupsreject command instructs the printing system to reject print jobs to the specified destinations. The -r option sets the reason for
rejecting print jobs. If not specified, the reason defaults to "Reason Unknown".
OPTIONS
The following options are supported by both cupsaccept and cupsreject:
-E Forces encryption when connecting to the server.
-U username
Sets the username that is sent when connecting to the server.
-h hostname[:port]
Chooses an alternate server.
-r "reason"
Sets the reason string that is shown for a printer that is rejecting jobs.
CONFORMING TO
The cupsaccept and cupsreject commands correspond to the System V printing system commands "accept" and "reject", respectively. Unlike the
System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#". Also, printer and
class names are not case-sensitive.
Finally, the CUPS versions may ask the user for an access password depending on the printing system configuration.
SEE ALSO cancel(1), cupsenable(8), lp(1), lpadmin(8), lpstat(1),
CUPS Online Help (http://localhost:631/help)
COPYRIGHT
Copyright (C) 2007-2017 by Apple Inc.
10 June 2014 CUPS cupsaccept(8)