Sponsored Content
Top Forums Shell Programming and Scripting Remove original file from directory after bash executes Post 302980102 by RudiC on Wednesday 24th of August 2016 02:45:55 AM
Old 08-24-2016
As usual - what's the real result of that operation and what be the error messages?

You may know - or suspect at least - that your approach is overly complicated?
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed over writes my original file (using sed to remove leading spaces)

Hello and thx for reading this I'm using sed to remove only the leading spaces in a file bash-280R# cat foofile some text some text some text some text some text bash-280R# bash-280R# sed 's/^ *//' foofile > foofile.use bash-280R# cat foofile.use some text some text some text... (6 Replies)
Discussion started by: laser
6 Replies

2. UNIX for Dummies Questions & Answers

Remove n lines from every file in a directory

Hello, I would like to remove n lines from all the files in a given directory. If it were one file, I can use the sed 'start, finish d' command. How can I extend this to an entire directory of files? Thanks, Gussi. (2 Replies)
Discussion started by: Gussifinknottle
2 Replies

3. Solaris

Remove the zfs snapshot keeping the original volume and clone

I created a snapshot and subsequent clone of a zfs volume. But now i 'm not able to remove the snapshot it gives me following error zfs destroy newpool/ldom2/zdisk4@bootimg cannot destroy 'newpool/ldom2/zdisk4@bootimg': snapshot has dependent clones use '-R' to destroy the following... (7 Replies)
Discussion started by: fugitive
7 Replies

4. UNIX for Advanced & Expert Users

rsync deletes original directory

Hi I have a strange problem. Sometimes when I execute the below command something wierd happens. rsync -avz -e ssh travegre@travegre.net: ../travegre.net/ the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets deleted... (4 Replies)
Discussion started by: travegre
4 Replies

5. UNIX for Dummies Questions & Answers

Remove part of file names in a directory

Hi, i have a directory full of pictures, .jpg files. Half of them begin with "beach_" (for ex beach_123_123456.jpg) i'm looking for a command to remove the "beach_" from all files in the directory. thanks (4 Replies)
Discussion started by: robertmanalio
4 Replies

6. Shell Programming and Scripting

Remove duplicates and update last 2 digits of the original row with 0's

Hi, I have a requirement where I have to remove duplicates from a file based on the first 8 chars (It is fixed width file of 10 chars length) and whenever a duplicate row is found, its original row's last 2 chars should be updated to all 0's. I thought of using sort -u -k 1.1,1.8... (4 Replies)
Discussion started by: farawaydsky
4 Replies

7. Shell Programming and Scripting

How to remove '^[[00m' in bash file?

Hi, This should be a simple one: I run the following commands in bash and ksh respectively but got differenant results: # ls -l /var/log > /tmp/a # vi /tmp/a In bash shell, I got: ^ In ksh, I got: total 828552 -rw-r----- 1 root root 189 Aug 9 00:00 acpid -rw-r----- 1 root... (7 Replies)
Discussion started by: aixlover
7 Replies

8. Shell Programming and Scripting

Bash executes first part of script but not second

My bash below verifies the integrity of all .bam in a directory and writes the out output to a .txt file. That is part one of the script that works. The second part of the bash searches each one of the .txt files for a string "(SUCCESS)" and if found display a message and if it is not found... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

Scan and remove if file infected using bash

The below bash runs clamav on all files in DIR and produces virus-scan.log. My question is the portion in bold is supposed to move the infected files, lines not OK, to /home/cmccabe/quarantine. Does the bash look correct? Thank you :). virus-scan.log Mon Jan 16 14:39:05 CST 2017... (5 Replies)
Discussion started by: cmccabe
5 Replies

10. Programming

Cant remove directory on bash script

hi all, this is my script and as you can see in the screenshot i attach its not deleting the directory in the source folder #!/bin/bash cd /vol/cha-work/_ARCHIVE/to_be_archived/audio/robert_test temp=/mnt/robert_test/temp dest=/vol/cha-archive/audio echo "is this archive for an... (2 Replies)
Discussion started by: robertkwild
2 Replies
LDAP_FIRST_REFERENCE(3) 				     Library Functions Manual					   LDAP_FIRST_REFERENCE(3)

NAME
ldap_first_reference, ldap_next_reference, ldap_count_references - Stepping through continuation references in a result chain LIBRARY
OpenLDAP LDAP (libldap, -lldap) SYNOPSIS
#include <ldap.h> int ldap_count_references( LDAP *ld, LDAPMessage *result ) LDAPMessage *ldap_first_reference( LDAP *ld, LDAPMessage *result ) LDAPMessage *ldap_next_reference( LDAP *ld, LDAPMessage *reference ) DESCRIPTION
These routines are used to step through the continuation references in a result chain received from ldap_result(3) or the synchronous LDAP search operation routines. The ldap_first_reference() routine is used to retrieve the first reference message in a result chain. It takes the result as returned by a call to ldap_result(3), ldap_search_s(3) or ldap_search_st(3) and returns a pointer to the first reference message in the result chain. This pointer should be supplied on a subsequent call to ldap_next_reference() to get the next reference message, the result of which should be supplied to the next call to ldap_next_reference(), etc. ldap_next_reference() will return NULL when there are no more reference mes- sages. The reference messages returned from these calls are used by ldap_parse_reference(3) to extract referrals and controls. A count of the number of reference messages in the search result can be obtained by calling ldap_count_references(). It can also be used to count the number of reference messages remaining in a result chain. ERRORS
If an error occurs in ldap_first_reference() or ldap_next_reference(), NULL is returned. If an error occurs in ldap_count_references(), -1 is returned. SEE ALSO
ldap(3), ldap_result(3), ldap_search(3), ldap_parse_reference(3) ACKNOWLEDGEMENTS
OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from the University of Michigan LDAP 3.3 Release. OpenLDAP 2017/06/01 LDAP_FIRST_REFERENCE(3)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy