• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Simple unix script help

n0cmonkey

Elite Member
Or more appropriately named: Why the heck doesn't this work?

cat test1.n0c
1

cat dates
20041201
20041202
20041203

cat test1.n0c dates
1
20041201
20041202
20041203

cat test1.n0c dates | tr '\n' ,
1,20041201,20041202,20041203

cat test1.n0c | sed -e 's/1/2/'
2

cat test1.n0c dates | sed -e 's/1/2'
2
20041201
20041202
20041203

cat test1.n0c dates | tr '\n' , | sed -e 's/1/2/'

I'm confused.
 
if a , at the beginning would help, can't you just echo one before passing it to sed? echo "," `cat...` | sed ...

haven't really given any thought to why it doesn't do what you want.
 
Originally posted by: oog
if a , at the beginning would help, can't you just echo one before passing it to sed? echo "," `cat...` | sed ...

haven't really given any thought to why it doesn't do what you want.

That might work. I managed to find a way around the whole situation, but I'm still interested in why the situation at the top doesn't work. 😛
 
Back
Top