Skip to main content
Answer

Extension attribute help

  • January 5, 2012
  • 6 replies
  • 16 views

Forum|alt.badge.img+21

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?

Best answer by sean

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

6 replies

Forum|alt.badge.img+12
  • Contributor
  • Answer
  • January 5, 2012

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


Forum|alt.badge.img+21
  • Author
  • Honored Contributor
  • January 5, 2012

Thanks very much


Forum|alt.badge.img+12
  • Contributor
  • January 5, 2012

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.


Forum|alt.badge.img+21
  • Author
  • Honored Contributor
  • January 6, 2012

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


Forum|alt.badge.img+21
  • Author
  • Honored Contributor
  • January 6, 2012

Apologies. I was being thick


Forum|alt.badge.img+12
  • Contributor
  • January 6, 2012

XD