Posted on 11-20-2019 10:28 AM
Hello,
I'm very new to scripting and need help getting a specific line from a txt file. I need to get an Adobe Challenge Key for our License renewal process. I figured out a way of packaging the terminal tool kit and running a script to get a text file as the output. Now I'm struggling to figure out a way to get key back from each computer. I just need the fourth line.
Solved! Go to Solution.
Posted on 11-20-2019 10:51 AM
I think this is what you want...the 1st line in the script creates a blank .txt file in a path you so choose.
Then once the blank .txt file is created, The second line outputs the 4th Line from the Adobe_License.txt & writes it into the blank .txt file.
With this you can do what ever you want, you can create an extension attribute & echo blank .txt files contents so all the computers checking in will display the key in your jamf inventory, etc
#!/bin/sh
sudo touch /Path/to/Blank.txt
sed -n 4p /Users/Shared/Adobe_License ToolKit/Adobe_License.txt > /Path/to/Blank.txt
Posted on 11-20-2019 10:51 AM
I think this is what you want...the 1st line in the script creates a blank .txt file in a path you so choose.
Then once the blank .txt file is created, The second line outputs the 4th Line from the Adobe_License.txt & writes it into the blank .txt file.
With this you can do what ever you want, you can create an extension attribute & echo blank .txt files contents so all the computers checking in will display the key in your jamf inventory, etc
#!/bin/sh
sudo touch /Path/to/Blank.txt
sed -n 4p /Users/Shared/Adobe_License ToolKit/Adobe_License.txt > /Path/to/Blank.txt
Posted on 11-20-2019 02:15 PM
@Hugonaut That definitely helped me out. Thanks for the help.
Posted on 11-21-2019 07:50 AM
@odnlinx You're welcome glad it helped!