Skip to main content
deleted 4 characters in body
Source Link
forquare
  • 3.6k
  • 5
  • 23
  • 32

sed is printing the file with the substitution you told it to make.

I think a better idea might be the following:

#!/bin/bash

IDS=$(curl -v --silent "http://example.com" 2>&1 | grep -Eo 'data-user_id="[0-9]+"' | grep -Eo "[0-9]+")

echo "$IDS" | sedtr 's/' /\n/g'' '\n' >> "ids"

This will echo $IDS and apply the space to new line substitutiontranslation before appending to the file.

sed is printing the file with the substitution you told it to make.

I think a better idea might be the following:

#!/bin/bash

IDS=$(curl -v --silent "http://example.com" 2>&1 | grep -Eo 'data-user_id="[0-9]+"' | grep -Eo "[0-9]+")

echo "$IDS" | sed 's/ /\n/g' >> "ids"

This will echo $IDS and apply the space to new line substitution before appending to the file.

sed is printing the file with the substitution you told it to make.

I think a better idea might be the following:

#!/bin/bash

IDS=$(curl -v --silent "http://example.com" 2>&1 | grep -Eo 'data-user_id="[0-9]+"' | grep -Eo "[0-9]+")

echo "$IDS" | tr ' ' '\n' >> "ids"

This will echo $IDS and apply the space to new line translation before appending to the file.

Source Link
forquare
  • 3.6k
  • 5
  • 23
  • 32

sed is printing the file with the substitution you told it to make.

I think a better idea might be the following:

#!/bin/bash

IDS=$(curl -v --silent "http://example.com" 2>&1 | grep -Eo 'data-user_id="[0-9]+"' | grep -Eo "[0-9]+")

echo "$IDS" | sed 's/ /\n/g' >> "ids"

This will echo $IDS and apply the space to new line substitution before appending to the file.