Sponsored Content
Top Forums Shell Programming and Scripting Calling a find/remove within a script Post 302997510 by AbelLuis on Monday 15th of May 2017 01:35:28 PM
Old 05-15-2017
Quote:
Originally Posted by jeffs42885
Looks like the echo stays the same. I was trying to escape the items identified in -name.

Code:
[me@server:/me/scripts]> ./prune.ksh
find: incomplete statement
find /directory/holding -type f ! -name "*.gz" ! -name "*PDF*" ! -name "*TIF*" -size +1000k -mmin +120 -exec gzip {}+

Hi,
Try this:

Code:
find /directory/holding -type f ! -name "*.gz" ! -name "*PDF*" ! -name "*TIF*" -size +1000k -mmin +120 -exec gzip {}+ \;

The final \; for the exec clause is mandatory. I don't know why you add the plus sign to the filename : {}+ .

Try
Code:
-exec gzip {} \;

.


Regards.
 

10 More Discussions You Might Find Interesting

1. Programming

How to Find who is calling me?

Hi, I was trying to find from the function which is called by some other function but is it possiable by the calling funcation that who is calling me? For example int function1() { // do something return 0 ; } char function2() { // do something function1() ; // is... (9 Replies)
Discussion started by: uxbala
9 Replies

2. Cybersecurity

i am trying to find out who is calling me

they are having an operator call my home line and also my cell number and they are typing and the operator tells me what they are typing on their computer. i nevere heard of this. it is new to me. it is free the operator said, they knew my name and also a friend of mine's name...the phone says the... (2 Replies)
Discussion started by: gail
2 Replies

3. Shell Programming and Scripting

Script to find and remove characters

Hi. I have many files in a folder, and even more in the subfolders. I need a script that finds and removes certain characters (them being /n in this one) in the files in the folder and it's subfolders. So, could someone write me a script that works in Linux, does this: Searchs for "/n" in... (5 Replies)
Discussion started by: Zerby
5 Replies

4. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

5. Shell Programming and Scripting

Calling a Perl script in a Bash script -Odd Situation

I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell... (5 Replies)
Discussion started by: leepet01
5 Replies

6. Homework & Coursework Questions

Shell script calling Perl function, sort and find data, write to new files

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I must write a shell script that calls two external Perl functions--one of which sorts the data in a file, and... (6 Replies)
Discussion started by: kowit010
6 Replies

7. Shell Programming and Scripting

Can't remove spaces with sed when calling it from sh -c

The following command works echo "some text with spaces" | sh -c 'sed -e 's/t//g''But this doesn't and should echo "some text with spaces" | sh -c 'sed -e 's/ //g''Any ideas? (3 Replies)
Discussion started by: Tribe
3 Replies

8. Shell Programming and Scripting

find -exec How to add additional parameter when calling a funtion

Hello Current working script is : # # my_script BEGIN # function a_function { FIRST_PARAM="$1" DO_SOMETHING "$FIRST_PARAM" } export -f a_function START_HERE="/home/some_user/Documents" find $START_HERE" -exec bash -c 'a_function "$0" ' {} \; (5 Replies)
Discussion started by: jcdole
5 Replies

9. Shell Programming and Scripting

Calling specific characters from a find variable

I'm trying to do something like this: find . -name blablabla -exec ln -s ./"{:53:14} blablabla" \; The idea is find blablabla and create a symbolic link to it using part of it's path and then it's name, "blablabla." I just don't know if I can call characters out of a find variable. ... (16 Replies)
Discussion started by: scribling
16 Replies

10. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies
IRSEND(1)							   User Commands							 IRSEND(1)

NAME
irsend - basic LIRC program to send infra-red commands SYNOPSIS
irsend [options] DIRECTIVE REMOTE CODE [CODE...] DESCRIPTION
Asks the lircd daemon to send one or more CIR (Consumer Infra-Red) commands. This is intended for remote control of electronic devices such as TV boxes, HiFi sets, etc. DIRECTIVE can be: SEND_ONCE - send CODE [CODE ...] once SEND_START - start repeating CODE SEND_STOP - stop repeating CODE LIST - list configured remote items SET_TRANSMITTERS - set transmitters NUM [NUM ...] SIMULATE - simulate IR event REMOTE is the name of a remote, as described in the lircd configuration file. CODE is the name of a remote control key of REMOTE, as it appears in the lircd configuration file. NUM is the transmitter number of the hardware device. For the LIST DIRECTIVE, REMOTE and/or CODE can be empty: LIST "" "" - list all configured remote names LIST REMOTE "" - list all codes of REMOTE LIST REMOTE CODE - list only CODE of REMOTE The SIMULATE command only works if it has been explicitly enabled in lircd. -h --help display usage summary -v --version display version -d --device use given lircd socket [/var/run/lirc/lircd] -a --address=host[:port] connect to lircd at this address -# --count=n send command n times EXAMPLES
irsend LIST DenonTuner "" irsend SEND_ONCE DenonTuner PROG-SCAN irsend SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP irsend SEND_START OnkyoAmpli VOL-DOWN ; sleep 3 irsend SEND_STOP OnkyoAmpli VOL-DOWN irsend SET_TRANSMITTERS 1 irsend SET_TRANSMITTERS 1 3 4 irsend SIMULATE "0000000000000476 00 OK TECHNISAT_ST3004S" FILES
/etc/lirc/lircd.conf Default lircd configuration file. It should contain all the remotes, their infra-red codes and the corresponding timing and wave- form details. DIAGNOSTICS
If lircd is not running (or /var/run/lirc/lircd lacks write permissions) irsend aborts with the following diagnostics: "irsend: could not connect to socket" "irsend: Connection refused" (or "Permission denied"). SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory. lircd(8), mode2(1), smode2(1), xmode2(1), irrecord(1), irw(1), http://www.lirc.org. irsend 0.9.0-pre1 October 2010 IRSEND(1)
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy