We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,874 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

shell script cat >

I'M trying to write a shell script using && so that each line will only execute if the preceding line executed without any problems.

How would I do that with the following cat:?

cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF 


&


sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
        scripts/test-installation.pl
unset DL
3
Contributors
2
Replies
2 Days
Discussion Span
9 Months Ago
Last Updated
3
Views
Garrett85
Posting Pro in Training
426 posts since Oct 2009
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

"nsswitch.conf - System Databases and Name Service Switch configuration file"
Nothing in /etc/nsswitch.conf "executes", perhaps you have another example?

Habitual
Light Poster
28 posts since Jan 2012
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

The commands that this script runs are from the linux from scratch project. I just need to know how to write a script with the cat redirection, sed and unset using && to verify that each line executed correctly before continueing to the next line.

Garrett85
Posting Pro in Training
426 posts since Oct 2009
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0620 seconds using 2.63MB