10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've found this script part on the stackoverflow:
if ; then
sudo bash "$0" "$@";
exit "$?";
fi
I realized that sudo bash "$0" "$@"; is the only needed for me.
But the strange thing happens when I move this line outside the IF statement:
sudo bash "$0" "$@"; stops the... (9 Replies)
Discussion started by: boqsc
9 Replies
2. Shell Programming and Scripting
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"
They all returned the match:
./folder/file.pdf
:b:
This find returned no matches:
$ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies
3. Shell Programming and Scripting
I am new to bash/shell scripting.
I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”.
I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies
4. Shell Programming and Scripting
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I'm trying to understand why the find command below is not listing a directory which was modified long back from the number of days specified in the mtime part. :confused:
user-aster :/mydir
$ ls -ld 1607570a-4fed44bb-4988
drwxr-xr-x 3 xyz abc 4096 Jun 29 01:02 1607570a-4fed44bb-4988... (4 Replies)
Discussion started by: aster007
4 Replies
6. Shell Programming and Scripting
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies
7. Shell Programming and Scripting
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)
Discussion started by: shis100
7 Replies
8. UNIX for Dummies Questions & Answers
I want to use the find command to search a ton of files, but I want to break it up into multiple machines. I want to search for files with "filename." in the title.
The location I want to search is:
/u/*/*/*/stuff
On the first computer I want to search:
/u//*/*/stuff
Right now I am doing... (1 Reply)
Discussion started by: msf5042
1 Replies
9. Shell Programming and Scripting
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Discussion started by: swamymns
9 Replies
10. Shell Programming and Scripting
problem String
~~~~~~~~~~~~~~~~~~
icecream= { smart peopleLink "good" LC "happy" ,
smartpeopleLink "dull" LC "sad" }
aend = {smart vc4 eatr kalu}
output needed
~~~~~~~~~~~~~~~~~~
smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad"
smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
ippfind(1) Apple Inc. ippfind(1)
NAME
ippfind - find internet printing protocol printers
SYNOPSIS
ippfind [ options ] regtype[,subtype][.domain.] ... [ expression ... ] ippfind [ options ] name[.regtype[.domain.]] ... [ expression ...
] ippfind --help ippfind --version
OPTIONS
--help
Show program help
--version
Show program version
-4 Use IPv4 when listing
-6 Use IPv6 when listing
-T seconds
Specify find timeout in seconds. If 1 or less, ippfind stops as soon as it thinks it has found everything. The default is 1 second.
-V version
Specifies the IPP version when listing. Supported values are 1.1, 2.0, 2.1, and 2.2.
DESCRIPTION
ippfind finds services registered with a DNS server or available through local devices. Its primary purpose is to find IPP printers and
show their URIs, show their current status, or run commands. For example, to show the status of all registered IPP printers on your net-
work, run:
ippfind --ls
Similarly, to send a PostScript test page to every PostScript printer, run:
ippfind --txt-pdl application/postscript --exec ipptool
-f onepage-letter.ps '{}' print-job.test ;
REGISTRATION TYPES
ippfind supports the following registration types:
_http._tcp
HyperText Transport Protocol (HTTP, RFC 2616)
_https._tcp
Secure HyperText Transport Protocol (HTTPS, RFC 2818)
_ipp._tcp
Internet Printing Protocol (IPP, RFC 2911)
_ipps._tcp
Secure Internet Printing Protocol (IPPS, draft)
_printer._tcp
Line Printer Daemon (LPD, RFC 1179)
EXPRESSIONS
ippfind supports expressions much like the find(1) utility. However, unlike find, ippfind uses POSIX regular expressions instead of shell
filename matching patterns. If --exec, -l, --ls, -p, --print, --print-name, -q, --quiet, -s, or -x is not specified, ippfind adds --print
to print the service URI of anything it finds. The following expressions are supported:
-d regex
--domain regex
True if the domain matches the given regular expression.
--false
Always false.
-h regex
--host regex
True is the hostname matches the given regular expression.
-l
--ls Lists attributes returned by Get-Printer-Attributes for IPP printers and traditional find "-ls" output for HTTP URLs. The result is
true if the URI is accessible, false otherwise.
--local
True if the service is local to this computer.
-n regex
--name regex
True if the service instance name matches the given regular expression.
--path regex
True if the URI resource path matches the given regular expression.
-P number[-number]
--port number[-number]
True if the port matches the given number or range.
-p
--print
Prints the URI if the result of previous expressions is true. The result is always true.
-q
--quiet
Quiet mode - just returns the exit codes below.
-r
--remote
True if the service is not local to this computer.
-s
--print-name
Prints the service instance name if the result of previous expressions is true. The result is always true.
--true
Always true.
-t key
--txt key
True if the TXT record contains the named key.
--txt-key regex
True if the TXT record contains the named key and matches the given regular expression.
-u regex
--uri regex
True if the URI matches the given regular expression.
-x utility [argument ...] ;
--exec utility [argument ...] ;
Executes the specified program if the current result is true. "{foo}" arguments are replaced with the corresponding value - see SUB-
STITUTIONS below.
Expressions may also contain modifiers:
( expression )
Group the result of expressions.
! expression
--not expression
Unary NOT of the expression.
expression expression
expression --and expression
Logical AND of expressions.
expression --or expression
Logical OR of expressions.
SUBSTITUTIONS
The substitutions for "{foo}" in -e and --exec are:
{} URI
{service_domain}
Domain name, e.g., "example.com.", "local.", etc.
{service_hostname}
Fully-qualified domain name, e.g., "printer.example.com.", "printer.local.", etc.
{service_name}
Service instance name, e.g., "My Fine Printer".
{service_port}
Port number for server, typically 631 for IPP and 80 for HTTP.
{service_regtype}
DNS-SD registration type, e.g., "_ipp._tcp", "_http._tcp", etc.
{service_scheme}
URI scheme for DNS-SD registration type, e.g., "ipp", "http", etc.
{service_uri}
URI for service, e.g., "ipp://printer.local./ipp/print", "http://printer.local./", etc.
{txt_key}
Value of TXT record key (lowercase).
ENVIRONMENT VARIABLES
When executing a program, ippfind sets the following environment variables for the matching service registration:
IPPFIND_SERVICE_DOMAIN
Domain name, e.g., "example.com.", "local.", etc.
IPPFIND_SERVICE_HOSTNAME
Fully-qualified domain name, e.g., "printer.example.com.", "printer.local.", etc.
IPPFIND_SERVICE_NAME
Service instance name, e.g., "My Fine Printer".
IPPFIND_SERVICE_PORT
Port number for server, typically 631 for IPP and 80 for HTTP.
IPPFIND_SERVICE_REGTYPE
DNS-SD registration type, e.g., "_ipp._tcp", "_http._tcp", etc.
IPPFIND_SERVICE_SCHEME
URI scheme for DNS-SD registration type, e.g., "ipp", "http", etc.
IPPFIND_SERVICE_URI
URI for service, e.g., "ipp://printer.local./ipp/print", "http://printer.local./", etc.
IPPFIND_TXT_KEY
Values of TXT record KEY (uppercase).
EXIT CODES
ippfind returns 0 if the result for all processed expressions is true, 1 if the result of any processed expression is false, 2 if browsing
or any query or resolution failed, 3 if an undefined option or invalid expression was specified, and 4 if it ran out of memory.
SEE ALSO
ipptool(1)
COPYRIGHT
Copyright 2013 by Apple Inc.
6 June 2013 CUPS ippfind(1)