IFS includes a newline, so you do not need xargs to convert newline to a space character.
My script sample needs a sorted input.
For example
BTW df does unneeded stat() and statfs(), a mount -v would be less overhead.
---------- Post updated at 10:17 ---------- Previous update was at 10:14 ----------
Please avoid unneeded cat! If you want to have /etc/fstab first in the line then do
This User Gave Thanks to MadeInGermany For This Post:
Is there a way to compare two floating points numbers in a bash script using perl? I've tried just using a bash if statement and it doesn't seem to support floating point numbers. Can the perl line read vars from bash then output a var to bash?
a=1.1 #from bash
b=1.5 #from bash
if... (3 Replies)
consider this as a csv file.
H,0002,0002,20100218,17.25,P,barani
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
T,5
N
i want to read the csv file and count the number of rows that start with D and... (11 Replies)
Hi,
I do little bash scripting so sorry for my ignorance.
How do I compare if the two variable not match and if they do not match run a command.
I was thinking a for loop but then I need another for loop for the 2nd list and I do not think that would work as in the real world there could... (2 Replies)
ok, so here is the issue, I have 2 arrays.
I need to be able to create a loop that will find ${ARRAY1 in the text doc, and replace it with ${ARRAY2 then write the results. I already have that working. The problem is, I need it to do that same result across however many items are in the 2... (2 Replies)
Beginner/Intermediate shell; comfortable in the command line.
I have been looking for a solution to a backup problem. I need to compare Directory 1 to Directory 2 and copy all modified or new files/directories from Directory 1 to Directory 3. I need the directory and file structure to be... (4 Replies)
Hello Friends
please help me to create script to compare 2 fiile which has rpm info .
File 1:
glibc-2.12.1.149.el6_6.5.x86_64.rpm
glibc-common-2.12-1.149.el6_6.5.x86_64.rpm
File 2 :
glibc-2.12.123.el6_6.5.x86_64.rpm
glibc-common-2.12-123.el6_6.5.x86_64.rpm
To compare file1... (1 Reply)
I am trying to write a Bash Script using a couple of arrays. I need to perform a countdown of sorts on an array done once daily, but each day would start with the numbers from the previous day. This is what I'm starting with :
#!/bin/bash
days=(9 8 7 6 5)
for (( i = 0 ; i < ${#days} ; i++... (4 Replies)
Currently i am building a script like based on region parameter it will filter the records in config file and then it will create a text file like ab.txt and it will read the path location in that file and now i need to compare the files name in the config file to files in the path of the config... (1 Reply)
I all
I have written a bash script for compare two date. One of those is a result of query, and another is current date.
I have a problem with the format, because the first is 09/12/19 18:50:30 but for having this result I have to do
d1DB=$(date -d "$valData" +'%m/%d/%y %T')
and the second... (9 Replies)
Discussion started by: rdie77
9 Replies
LEARN ABOUT BSD
getfstype
GETFSENT(3) Library Functions Manual GETFSENT(3)NAME
getfsent, getfsspec, getfsfile, getfstype, setfsent, endfsent - get file system descriptor file entry
SYNOPSIS
#include <fstab.h>
struct fstab *getfsent()
struct fstab *getfsspec(spec)
char *spec;
struct fstab *getfsfile(file)
char *file;
struct fstab *getfstype(type)
char *type;
int setfsent()
int endfsent()
DESCRIPTION
Getfsent, getfsspec, getfstype, and getfsfile each return a pointer to an object with the following structure containing the broken-out
fields of a line in the file system description file, <fstab.h>.
struct fstab {
char *fs_spec;
char *fs_file;
char *fs_type;
int fs_freq;
int fs_passno;
};
The fields have meanings described in fstab(5).
Getfsent reads the next line of the file, opening the file if necessary.
Setfsent opens and rewinds the file.
Endfsent closes the file.
Getfsspec and getfsfile sequentially search from the beginning of the file until a matching special file name or file system file name is
found, or until EOF is encountered. Getfstype does likewise, matching on the file system type field.
FILES
/etc/fstab
SEE ALSO fstab(5)DIAGNOSTICS
Null pointer (0) returned on EOF or error.
BUGS
All information is contained in a static area so it must be copied if it is to be saved.
4th Berkeley Distribution May 12, 1986 GETFSENT(3)