Avatar of dawber39
dawber39
Flag for United States of America asked on

Shell Script

Trying to create a shell script that will read the lines in a file handed to it in the command line. Look at the the fourth field of each line (which is numeric) and increase it by 1 - then print all the lines of the file with the new value.  
Shell ScriptingPerl

Avatar of undefined
Last Comment
dawber39

8/22/2022 - Mon
Tintin

awk '$4+=1 {print}' file >newfile

Open in new window

dawber39

ASKER
That would probably work if II added the file name to the script - but as it is - it is looking for a file called "file" I need it to read the file from the command line because there will be other files to run the script on
dawber39

ASKER
and I just need it to print out the results on the screen  - not to a new file
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
dawber39

ASKER
I should have mentioned that he fields are separated by :
ASKER CERTIFIED SOLUTION
Tintin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
dawber39

ASKER
Awesome dude
dawber39

ASKER
Love this site!!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.