Hi Jean
I require your help in writing a shell script. Iam zero in Unix programming. I have a large file about 400 MB of data, which contains about 50000 XML messages seperated by a Tab, I think. I need to extract only 4 values from each XML message and write it onto a new file. Please help me... (2 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
but keep if does not
I have a file: --> my.out
foo: bar
foo: moo
blarg
i am on vacation
foo: goose
foo: lucy
foo: moose
foo: stucky
groover@monkey.org
foo: bozo
grimace@gonzo.net
dear sir - blargo blargo
foo: goon
foo: sloppy
foo: saudi
gimme gimme gimme (3 Replies)
Gurus,
I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below:
Name: xxxx yyyy nnnn
Description: dfffgs sdgsgsf hsfhhs
afgghhjdgj
fjklllll gsfhfh
Updated: jafgadsgg gsg
Corrected: date today
The file consists of line like these.
... (13 Replies)
Hi,
I have requirement that I need to split my input file into two files based on a search pattern "abc"
For eg. my input file has below content
abc
defgh
zyx
I need file 1 with
abc
and file2 with
defgh
zyx
I can use grep command to acheive this. But with grep I need... (8 Replies)
I was wondering how I can read values from a file and then proceed if those values
match a user input. For example (a simple one), a user inputs their name, then we check if that name is in a file of usernames. If it is, it says proceed, if not, then it says you are not authorized.
... (5 Replies)
Hello to all,
Maybe someone could help me, my question is:
How can a filter the print of command ls for the files with names of the form "abc*.txt" including the path?
I've done this:
If I move with command cd to /My/Path/Is/This/ and send this command:
ls -lst abc*.txt -i... (37 Replies)
I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID
Scenario is: delete all line if Employee Number (1st column) contains below
1. Non-numeric Employee Number
2. Employee Number that... (3 Replies)
Hi Forum.
I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script.
Any feedback will be greatly appreciated.
... (19 Replies)
Hello.
A_LIGNE="cnezJ,V ,FMZ fd,Mok CODKJ,F SOME_WORD fcnQ, VMQKV Q"
A_PATTERN="SOME_WORD"
sed 's/'$A_PATTERN'//g' <<< "$A_LINE"will remove 'SOME_WORD' and give :
"cnezJ,V ,FMZ fd,Mok CODKJ,F fcnQ, VMQKV Q"A_PATTERN="SOME_WORD]"
sed 's/'$A_PATTERN'//g' <<< "$A_LINE"will remove... (4 Replies)
Discussion started by: jcdole
4 Replies
LEARN ABOUT XFREE86
git-name-rev
GIT-NAME-REV(1) Git Manual GIT-NAME-REV(1)NAME
git-name-rev - Find symbolic names for given revs
SYNOPSIS
git name-rev [--tags] [--refs=<pattern>]
( --all | --stdin | <commit-ish>... )
DESCRIPTION
Finds symbolic names suitable for human digestion for revisions given in any format parsable by git rev-parse.
OPTIONS --tags
Do not use branch names, but only tags to name the commits
--refs=<pattern>
Only use refs whose names match a given shell pattern. The pattern can be one of branch name, tag name or fully qualified ref name. If
given multiple times, use refs whose names match any of the given shell patterns. Use --no-refs to clear any previous ref patterns
given.
--exclude=<pattern>
Do not use any ref whose name matches a given shell pattern. The pattern can be one of branch name, tag name or fully qualified ref
name. If given multiple times, a ref will be excluded when it matches any of the given patterns. When used together with --refs, a ref
will be used as a match only when it matches at least one --refs pattern and does not match any --exclude patterns. Use --no-exclude to
clear the list of exclude patterns.
--all
List all commits reachable from all refs
--stdin
Transform stdin by substituting all the 40-character SHA-1 hexes (say $hex) with "$hex ($rev_name)". When used with --name-only,
substitute with "$rev_name", omitting $hex altogether. Intended for the scripter's use.
--name-only
Instead of printing both the SHA-1 and the name, print only the name. If given with --tags the usual tag prefix of "tags/" is also
omitted from the name, matching the output of git-describe more closely.
--no-undefined
Die with error code != 0 when a reference is undefined, instead of printing undefined.
--always
Show uniquely abbreviated commit object as fallback.
EXAMPLE
Given a commit, find out where it is relative to the local refs. Say somebody wrote you about that fantastic commit
33db5f4d9027a10e477ccf054b2c1ab94f74c85a. Of course, you look into the commit, but that only tells you what happened, but not the context.
Enter git name-rev:
% git name-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99~940
Now you are wiser, because you know that it happened 940 revisions before v0.99.
Another nice thing you can do is:
% git log | git name-rev --stdin
GIT
Part of the git(1) suite
Git 2.17.1 10/05/2018 GIT-NAME-REV(1)