I do not want to change the find command because I am using multiple fields from that output. In fact I need to capture the 9th ($9) field and manipulate the output so that I only capture the department folder.
ex: the output is like:
-rwx------+ 1 admin staff 71680 Jun 12 2010 /Volumes/Sys_Data/Server One/Department/.../.../.../.../...
From this output I capture the $5 field for size counting and the $3 field for user tracking. Now I want to capture the $9 field with the path and only capture the Department field. So I can keep track of the departments as well.
---------- Post updated at 08:00 AM ---------- Previous update was at 06:44 AM ----------
is there any idea why this doesn't work?
The syntax is wrong for awk. Post the error you get. Alternatively can you try the below sed if the output from the find command is as you posted in post# 3..
hi there
I am trying to get a value from a remote machine into a local variable. To get this value i want to use awk but im having trouble getting it to run, am i escaping in the right places here and using the right quotes (i must have tried a million combinations :()
# VAR=`ssh server1... (5 Replies)
In awk script,
#!/bin/sh
awk 'BEGIN{i=0;}{i=i+5;}END{print i}' in.txt
vr=0;
vr=$i;
echo "$vr"
How can i assign that value of i in $vr(variable) of shell script? (7 Replies)
Hi,
I have a large flat file from host without delimiter. I'm transforming this file to a csv file using statements like
# Row 03: Customer / field position 3059 +20
WOFABNAM=substr( $0, 3059, 20 );
and deleting the trailing whitespaces before and after with that
sub( /^ +/, "",... (4 Replies)
Hi.
How to change string variable in awk?
for example, I parse with awk script text file named some_name_with_extension.txt
I want to print only some_name in my script
....
varCompName = FILENAME
print varCompName
How to put not all symbols from FILENAME to variable?
thank you
This... (4 Replies)
The following is part of a larger shell script
grep -v "Col1" my_test.log | grep -v "-" | awk '$5 == "Y" {print $1}'
instead of printing, can I set set $1 to a variable that the rest of the shell script can read?
if $5 == Y, I want to call another shell script and pass $1 as a... (2 Replies)
hi i want to find the size of a folder and assign it to a variable and then compare if it is greater than 1 gb.
i am doin this script, but it is throwing error....
#!/bin/ksh
cd . | du -s | size = awk '{print $1}'
if size >= 112000
then
echo size high
fi
ERROR : (4 Replies)
Hello All,
I have csv file, where one of fields is date (yyyy/mm/dd 00:00:00). Using awk I am trying to find all records with date newer/older than specific date. My idea was to compare unix timestamps of both dates:
start=`date +%s -d "$DateStart"`
awk -v start="$start" -v current=`date +%s... (34 Replies)
Hi Experts,
I am trying to get system output to capture inside awk , but not working:
Please advise if this is possible :
I am trying something like this but not working, the output is coming wrong:
echo "" | awk '{d=system ("date") ; print "Current date is:" , d }'
Thanks, (5 Replies)
I have a data file d0 that looks like this:
$cat d0
server1 running -n-cv- 8G 3.1% 1435d 15h
server2 running -n---- 8G 39% 660d 22h
server3 running -n--v- 8G 2.5% 1173d 6h
server4 running -n---- 8G 1.1% 1048d 20h... (2 Replies)
Discussion started by: jake0391S
2 Replies
LEARN ABOUT FREEBSD
pcap_can_set_rfmon
PCAP_CAN_SET_RFMON(3) Library Functions Manual PCAP_CAN_SET_RFMON(3)NAME
pcap_can_set_rfmon - check whether monitor mode can be set for a not-yet-activated capture handle
SYNOPSIS
#include <pcap/pcap.h>
int pcap_can_set_rfmon(pcap_t *p);
DESCRIPTION
pcap_can_set_rfmon() checks whether monitor mode could be set on a capture handle when the handle is activated.
RETURN VALUE
pcap_can_set_rfmon() returns 0 if monitor mode could not be set, 1 if monitor mode could be set, PCAP_ERROR_NO_SUCH_DEVICE if the capture
source specified when the handle was created doesn't exist, PCAP_ERROR_PERM_DENIED if the process doesn't have permission to check whether
monitor mode could be supported, PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated, or PCAP_ERROR if an error
occurred. If PCAP_ERROR is returned, pcap_geterr() or pcap_perror() may be called with p as an argument to fetch or display the error
text.
SEE ALSO pcap(3), pcap_create(3), pcap_activate(3), pcap_set_rfmon(3)
18 May 2010 PCAP_CAN_SET_RFMON(3)