10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix.
I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice.
Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
2. Shell Programming and Scripting
Hi,
using awk command I want to print filenames and the last line of each file, in a single command line statement.
I want to use 'awk', because I want to add more functionality to this logic later.
I tried the following on *.sh files in the current directory
find . -type f -name "*.sh"... (26 Replies)
Discussion started by: ysrini
26 Replies
3. Shell Programming and Scripting
I can got the filename with this script. it's only show "-" in result.
cut -d , -f7 CSV_d.* | awk 'OFS=":"{print FILENAME,substr($1,1,8),substr($1,9,2),substr($1,11,2),substr($1,13,2)}' | sort |uniq (2 Replies)
Discussion started by: before4
2 Replies
4. Shell Programming and Scripting
Hi,
Please suggest a way to print number of words in the end of each line.
<input file>
red aunt house
blue sky
bat and ball game
<output file>
red aunt house 3
blue sky 2
bat and ball game 4
Thanks! (2 Replies)
Discussion started by: mira
2 Replies
5. Shell Programming and Scripting
hi everyone,
1.txt
981 I field1 > field2.a: aa, ..si01To:<f:a@a.com>From: <f:a@a.com>;tag=DVNgfRZBZRMi96 <f:a@1:333>;ZZZZZ: 12345
the output
field1 field2 <f:a@a.com>
the output is cut the string 3rd and 5th field, and get the value betwee "To:" and "From:", please advice.
... (1 Reply)
Discussion started by: jimmy_y
1 Replies
6. Shell Programming and Scripting
Hi All,
I have searched the forum and tried to print only matching(pattern) words from the file, but its printing entire line. I tried with grep -w. I am on sunsolaris.
Eg:
cat file
A|A|F1|F2|A|F3|A
A|F10|F11|F14|A|
F20|A|F21|A|F25
I have to search for F (F followed by numbers) and ... (5 Replies)
Discussion started by: gsjdrr
5 Replies
7. Shell Programming and Scripting
I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction?
for FILE in `cat list`; do
if ;
then
... (1 Reply)
Discussion started by: overkill
1 Replies
8. Shell Programming and Scripting
can u help me out to print last two words of each sentence of a file.
for example.
contents of input file:
i love songs
my favourite songs
sent
songs all kind
good buddy
Ouput file should contain:
love songs
favourite songs
sent
all kind
good buddy (5 Replies)
Discussion started by: pradeepreddy
5 Replies
9. Programming
It should be pretty simple but I'm just new to IDL and am workling through the command line and scripts(program.pro). If I want to save words to the bottom of a .ps file that I am putting a few plots in what should written in my code.
set_plot works for plots but apparently not words. Print... (0 Replies)
Discussion started by: luked
0 Replies
10. Shell Programming and Scripting
I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies