Hi i am trying to replace the header line from my file using the sed command as mentioned below,
sed "1s/.*/$new_header/" Test_file.csv
The above line replaces the header and prints in stdout , But How can i redirect the output to new file or replace in the files directly ?
sed "1s/.*/$new_header/" Test_file.csv > new_file.csv
The above command works fine , But i want to redirect to same file.