10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file like
file.
file.TODAY.THISYEAR
file.TODAY.LASTYEARI want to substitute the words in caps with their actual values so that output should look like
file.140805
file.140805.2014
file.140805.2013For this I am reading the file line bye line in an array and using multiple map... (1 Reply)
Discussion started by: sam05121988
1 Replies
2. Shell Programming and Scripting
Hello fellow awkers,
I am trying to combine the following awk statements into 1 so that the results are more accurate:
awk '/\=\+/ { count++ } END { print count}' filename
awk '/\=\?/ { count++ } END { print count}' filename
awk '/\=\-/ { count++ } END { print count}' filename
awk... (8 Replies)
Discussion started by: ux4me
8 Replies
3. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The issue I am having is part of a validation problem. My script will validate 3 or 4 parameters entered by the... (4 Replies)
Discussion started by: JonLaberge
4 Replies
4. Shell Programming and Scripting
Hello, this will be my first post. I've been browsing around for a bit and have found a lot of useful information on here, hopefully a solution can be provided to me.
Issue:
Alright, I am looking to search for strings within a file using variables.
I have a script that will accept 3 or 4... (2 Replies)
Discussion started by: JonLaberge
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have the following two awk statements which I'd like to consolidate into one by piping the output from the first into the second awk statement (rather than having to write kat.txt out to a file and then reading back in).
awk 'BEGIN {FS=OFS=" "} {printf("%s ", $2);for (x=7; x<=10;... (3 Replies)
Discussion started by: kasan0
3 Replies
6. Shell Programming and Scripting
below is something i inherited:
if && && ; then
HOST_SELECT="-m quadcore"
fi
if && && ; then
HOST_SELECT="-m quadcore"
fi
if && && ; then
HOST_SELECT="-m octocore1"
fibelow is what i changed it to:
if && && ; then
HOST_SELECT="-m quadcore"... (2 Replies)
Discussion started by: crimso
2 Replies
7. UNIX for Dummies Questions & Answers
Greetings!
I have been tasked to create a report off files we receive from our hardware suppliers. I need to grep these files for two fields 'Test_Version' and 'Model-Manufacturer' ; for each field, I need to capture their corresponding values.
When running each statement separately, I get... (4 Replies)
Discussion started by: alan
4 Replies
8. UNIX for Dummies Questions & Answers
I have a data file that looks like this:
infile:
A
13
Z
23
F
22
Z
413
R
16how do I combine the -A option with the -v option to get the lines that don't match 'Z' and their next lines?
the outfile should be:
A
13
F
22
R
16I tried: (1 Reply)
Discussion started by: jdhahbi
1 Replies
9. Shell Programming and Scripting
I have an awk statement that works but I am calling awk twice and I know there has to be a way to combine the two statements into one. The purpose is to pull out just the ip address from loopback1.
cat config.txt | nawk 'BEGIN {FS="\n"}{RS="!"}{if ( $0 ~ "interface loopback1" ) print$4}' | nawk... (5 Replies)
Discussion started by: numele
5 Replies
10. UNIX for Dummies Questions & Answers
Hi, I need to change military time to regular time. I know to use case to indicate whether a.m. or p.m. as follows:
case "$hour"
in
0? | 1 ) echo a.m.;;
1 ) echo p.m.;;
* ) echo p.m.;;
esac
My question is how do I add the hour and minute... (2 Replies)
Discussion started by: karp3158
2 Replies