08-08-2018
Well, I went for Library first, and changed only when failed...
Last edited by RudiC; 08-09-2018 at 05:26 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, i have a file like this below, and it my have n no. of lines. Moderator gave me a solution with awk, but it was working only for the first 2 lines because awk has a limitation. can anyone give me the solution, thank you
INPUT FILE:
1081 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WPCB-DT1 50 -... (11 Replies)
Discussion started by: injeti
11 Replies
2. Shell Programming and Scripting
I have a file in which email messages are stored in. Every email is separated by by a ^Z character (Control-Z).
I need to extract all emails after the 65,00th one to another file and delete them from the original file.
Any suggests on accomplishing this? (2 Replies)
Discussion started by: maxcell
2 Replies
3. UNIX for Dummies Questions & Answers
I am tryin to figure out how to extract interested text from file
example.txt
blah blah
blah a: child1
blah a: child2
blah b: parent1
blah blah
blah ....
blah a: child21
blah a: child22
blah a: child23
blah b: parent2
this kinda text repeats .. number of children is... (6 Replies)
Discussion started by: rajkishore
6 Replies
4. UNIX for Dummies Questions & Answers
Hi there,
I have some text files in unix format that processed by a program in windows, and when I open them with less or vi in linux, a warn for opening binary file is prompted, and as shown in vi, between every two characters there was inserted a "^@". How can I fix this. Plus, there are over... (2 Replies)
Discussion started by: dustinwang2003
2 Replies
5. Shell Programming and Scripting
I am wondering if there is a way via grep and sed to extract a string that is on the 2nd line below a known marker as in this example:
TextRel 203 0 0 "WELL:"
SetPosAbs 1287 -6676
TextRel 210 0 0 "AEP #2"
The marker is WELL:, but the string I need is "AEP #2". Can grep/sed handle this... (19 Replies)
Discussion started by: phudgens
19 Replies
6. Shell Programming and Scripting
I'm trying to use sed to replace string in text file but I've some problems with slash and new-line
for example I have to replace this string:
\> signal_rssi="
or this string where new-line is in the middle of the string:
"
/>
I'm using this code for the first case but it doesn't... (10 Replies)
Discussion started by: TheMrOrange
10 Replies
7. Shell Programming and Scripting
I have thousands of files in HTML that looks like this:
....
....
....
<!-- table horaire --> <!-- table horaire -->
<table border="0" cellspacing="0" cellpadding="0" class="tblHoraires" summary="Table des horaires de la ligne 12">
<tr>
<th scope="row"... (13 Replies)
Discussion started by: charafantah
13 Replies
8. Shell Programming and Scripting
Hello unix.com people!
How can I modify a text in format:
A:B:C
A:B:C
A:B:C
into
C/A/B
C/A/B
C/A/B
Note: Text is line by line and "C", "B", "A" fields are different each row.
Thanks in advance. (7 Replies)
Discussion started by: galford
7 Replies
9. Shell Programming and Scripting
Hello Unix.com,
How can i generate links like this:
i got
http://upload.com/1/1.txt
and i need to generate links from
http://upload.com/1/1.txt to http://upload.com/1000/1000.txt
Thanks in advance,
Galford D. Weller (4 Replies)
Discussion started by: galford
4 Replies
10. Shell Programming and Scripting
Guys, I have a variable in a script that I want to transform to into something else Im hoping you guys can help. It doesn't have to use sed/awk but I figured these would be the simplest.
DATE=20160120
I'd like to transform $DATE into "01-20-16" and move it into a new variable called... (8 Replies)
Discussion started by: dendenyc
8 Replies
LEARN ABOUT NETBSD
string_to_flags
STAT_FLAGS(3) BSD Library Functions Manual STAT_FLAGS(3)
NAME
string_to_flags, flags_to_string -- Stat flags parsing and printing functions
LIBRARY
System Utilities Library (libutil, -lutil)
SYNOPSIS
#include <util.h>
char *
flags_to_string(u_long flags, const char *def);
int
string_to_flags(char **stringp, u_long *setp, u_long clrp);
DESCRIPTION
The flags_to_string() and string_to_flags() functions are used by programs such as ls(1), mtree(8), makefs(8), etc., to parse and/or print
the st_flags field in the stat(2) structure.
They recognize the following flags:
String Flag Description
arch SF_ARCHIVED file is archived
nodump UF_NODUMP do not dump file
opaque UF_OPAQUE directory is opaque in union filesystems
sappnd SF_APPEND writes to the file may only append
schg SF_IMMUTABLE file cannot be changed; it is immutable
snap SF_SNAPSHOT file is a snapshot inode
uappnd UF_APPEND writes to the file may only append
uchg UF_IMMUTABLE file cannot be changed; it is immutable
The SF_APPEND and SF_IMMUTABLE flags are for the superuser only, whereas UF_APPEND and UF_IMMUTABLE are for the user only.
The flags_to_string() function converts the bits set in the flags argument to a comma-separated string and returns it. If no flags are set,
then the def string is returned. The returned string is allocated via malloc(3) and it is the responsibility of the caller to free(3) it.
The string_to_flags() function takes a stringp of space, comma, or tab separated flag names and places their bit value on the setp argument.
If the flag name is prefixed by: ``no'', then the bit value is placed on the clrp argument.
RETURN VALUES
flags_to_string() returns the symbolic representation of flags, the default string, or NULL if allocation failed.
string_to_flags() returns 0 on success and 1 if it fails to parse the string, setting stringp to point to the first string that it failed to
parse.
SEE ALSO
chflags(2), stat(2)
BSD
August 6, 2011 BSD