10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
${var%pattern}
removes the shortest suffix of $var patching pattern
${var%%pattern}
removes the longest suffix of $var patching pattern
${var#pattern}
removes the shortest prefix of $var patching pattern
${var##pattern}
removes the longest prefix of $var patching pattern (2 Replies)
Discussion started by: popeye
2 Replies
2. Shell Programming and Scripting
Hi guys,
This is probably very easy but I've no idea how to pull this out.
Basically, I need to find errors into a very large logfile. When you grep the ID, the output is like this:
+- Type: 799911 Code: Ret: 22728954 Mand: X Def: Des: UserDes: SeqNo: 2
+- Type: 799911 Code: Ret:... (5 Replies)
Discussion started by: Arkadia
5 Replies
3. Shell Programming and Scripting
I have a file like
blah
blah blah blah
this is the text I need,
which might be between 1-4 lines, but
always has a blank line above and below
it, and is at the end of the text file
the code tags don't show the trailing blank line. I started by deleting the last blank line with:
... (2 Replies)
Discussion started by: unclecameron
2 Replies
4. UNIX for Dummies Questions & Answers
I have a working directory on a server with over 100 INI files. For the most part, they are configured the same way. Each line will contain 1 or none variables listed from the first character in the line such as VariableName=0.
Unfortunately there are comments everywhere using the... (4 Replies)
Discussion started by: hindesite
4 Replies
5. Shell Programming and Scripting
Hi,
When I run the diff command using diff -yt file1 file2, I get the output in which original lines are truncated.
I tried using -W switch with diff. However, that does not produce exact output as I want. Is it possible to show entire line of file1 and file2 in diff command's output?
... (8 Replies)
Discussion started by: jal_capri
8 Replies
6. Shell Programming and Scripting
Dear all,
I want to show all lines between the first and the last appearance of a string in a file. This string is a input parameter of a script. I have some ideas with grep -n but i'm sure that I can get a better solution with SED or AWK
thanks! (3 Replies)
Discussion started by: antuan
3 Replies
7. Shell Programming and Scripting
Hi experts,
I want to grep a number 9366109380 from a file but it will also show me the next 5 lines. Below is the example-
when i grep 989366109380, i can also see the next 5 lines.
Line 1. <fullOperation>MAKE:NUMBER:9366109380:PPAY2;</fullOperation>
Line 2.... (10 Replies)
Discussion started by: thepurple
10 Replies
8. Shell Programming and Scripting
When i grep for a pattern the search results comes up with matching lines(some before the pattern and some after)...how can i limit the search so that it shows only the lines after the pattern specified (5 Replies)
Discussion started by: wannalearn
5 Replies
9. UNIX for Dummies Questions & Answers
I would like to be able to grep (or some such thing) a search argument and then display the line plus the preceding 3 lines of the file and the following 3 lines of the file. Any ideas? Thanks in advance! :D (3 Replies)
Discussion started by: robster
3 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I need a command that would let ls show number of lines in each file rather than file size in KBs.
I tried using wc -l as a source of input to ls but I found a problem cutting the file name since wc generates a space delimited list.
Any suggestions?
Thanks.
GmMike. (1 Reply)
Discussion started by: GMMike
1 Replies