Computing.Net > Forums > Unix > Sed Command in Unix

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sed Command in Unix

Reply to Message Icon

Name: Vj
Date: November 9, 2004 at 12:15:38 Pacific
OS: HP Unix
CPU/Ram: NA
Comment:

Can anyone explain me what does the sed command do in the following shell script? I came across this in one of the shell acripts.
The output of a SQL session is piped into it

sqlplus -s user/pass@db <<EOF
set heading off feedback off serveroutput on
select query_id, query_db_to_run,query_text from test where rownum = 1;
exit;
EOF
) | sed -e '/^$/d' -e 's/^[ ][ ]*/ /' |
read v_query_id v_query_db_to_run v_query_text




Sponsored Link
Ads by Google

Response Number 1
Name: kuhjaay
Date: November 11, 2004 at 13:14:36 Pacific
Reply:

I'm a newbie myself, but I think the first part:
sed '/^$/d'
will remove all blank lines from the file


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Sed Command in Unix

Sed Command in Unix www.computing.net/answers/unix/sed-command-in-unix/6561.html

SA2 Command in Unix www.computing.net/answers/unix/sa2-command-in-unix/1767.html

how to read binary files in Unix www.computing.net/answers/unix/how-to-read-binary-files-in-unix/4566.html