Posted on 01-05-2012 08:56 AM
Hello
I have an extension attribute which does a simply cat of a txt file.
The problem is the txt file has carriage returns in it and I would like to include them because the recon inventory shows all the information bunched together and i need to be able to separate the data Can anyone help at all?
Solved! Go to Solution.
Posted on 01-05-2012 09:05 AM
Welcome to my feature request. It used to, but Jamf stopped it doing this. Add yourself to the request and send your jamf contact the same information.
https://jamfnation.jamfsoftware.com/featureRequest.html?id=110
Sean
Posted on 01-05-2012 02:39 PM
Here is a way to translate the newlines into a different delimiter so you can parse it back out later.
$ cat test
blah
blah
blah
$ echo "<result>$(cat test | tr "
" ":")</result>"
<result>blah:blah:blah:</result>
$
*shrug*
May help a bit in the meantime.
Posted on 01-05-2012 09:05 AM
Welcome to my feature request. It used to, but Jamf stopped it doing this. Add yourself to the request and send your jamf contact the same information.
https://jamfnation.jamfsoftware.com/featureRequest.html?id=110
Sean
Posted on 01-05-2012 10:18 AM
Thanks very much
Posted on 01-05-2012 02:39 PM
Here is a way to translate the newlines into a different delimiter so you can parse it back out later.
$ cat test
blah
blah
blah
$ echo "<result>$(cat test | tr "
" ":")</result>"
<result>blah:blah:blah:</result>
$
*shrug*
May help a bit in the meantime.
Posted on 01-06-2012 01:27 AM
Hi rmanly
Please can you help i am not clear on your solution. I am currently using this but i do not know what to change it to
#!/bin/bash
drives=cat /var/tmp/external_drives_monitor/drives.txt
echo "<result>$drives</result>"
exit0
Posted on 01-06-2012 03:17 AM
Apologies. I was being thick
Posted on 01-06-2012 08:28 AM
XD