I think aka has a good point, but there is a slight complication to this, since according to the man page:
Quote:
The fuser utility shall write diagnostic messages to standard error.
The fuser utility also shall write the following to standard error:
The pathname of each named file is written followed immediately by a <colon>.
For each process ID written to standard output, the character 'c' shall be written to standard error if the process is using the file as its current directory and the character 'r' shall be written to standard error if the process is using the file as its root directory. Implementations may write other alphabetic characters to indicate other uses of files.
So when stderr is redirected to stdout (2>&1) the filename with a colon and a space is prepended to the process numbers and a newline is added at the end
If stderr is redirected to /dev/null (2>/dev/null) then the first PID is no longer in column 2 (also there is no longer a closing newline) , so then the awk part is no longer required (nor will it work properly), so instead one could try:
or -- is used here, so that file names that start with a - cannot break the command... ( The pattern used in the for loop for i in *${cdate}* would leave that possibility open, whereas with for i in usb* that would not be strictly necessary, but it wouldn't hurt either)
Last edited by Scrutinizer; 10-03-2014 at 01:12 AM..
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi All,
i am trying to ssh to a remote machine and execute certain command to remote machine through script.
i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as
expect: spawn id exp5 not open
while executing
"expect "$" {... (3 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)
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
Hi
How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ?
I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60.
tnx (4 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 All,
I have installed Solaris 10 on my AMD 64 3000+ system. I was playing with grub commands eeprom and bootadm commands. I screwed my boot-file and now am unable to boot the system. Gets error msg as "panic: cannot open /kernel/amd64/unix". I booted the system is filesafe and tried update the... (2 Replies)
keep getting an error when I try to revert to a snapshot:
"VMDB Failure" followed by "Unable to open snapshot file"
Im using vmware server 1.0.4, host OS is windows xp and guest OS is SLES.
Is there anything I can do to recover the snapshot or am I in trouble!?!?! (0 Replies)
Ok, I found this article:
https://www.unix.com/sun-solaris/19665-boot-cannot-open-kernel-sparcv9-unix.html
However it doesn't quite describe my situation.
I have created a jumpstart DVD that works great, and installs my customized Solaris-10 (Yes 10, not 8 or 9 per previous posts) . It... (6 Replies)