shanenin Posted January 27, 2006 Report Share Posted January 27, 2006 I have this very simple script. If the first command fails, I want the script to stop. I thought the "&&" operater would do that. This is not stopping the script#!/bin/bashmodprobe ath_pci &&modprobe wlan_scan_staifconfig ath0 upiwconfig ath0 essid "linksys" key 6A4601E10F858AF350C545A658dhcpcd ath0why isn't the operater stopping the script. To test it I ran it as regular user. I would think that it would stop after the first command fails with an exit code of non one, but it does not. Quote Link to post Share on other sites
jcl Posted January 27, 2006 Report Share Posted January 27, 2006 That script is equivalent to$ modprobe ath_pci && modprobe wlan_scan_sta$ ifconfig ath0 up$ iwconfig ath0 essid "linksys" key 6A4601E10F858AF350C545A658$ dhcpcd ath0 Quote Link to post Share on other sites
shanenin Posted January 27, 2006 Author Report Share Posted January 27, 2006 (edited) thanks for making that more clear. I suppose I could do thismodprobe ath_pci || exit 1modprobe wlan_scan_staifconfig ath0 upiwconfig ath0 essid "linksys" key 6A4601E10F858AF350C545A658dhcpcd ath0someone else reccomended I use the set commandset -e Edited January 27, 2006 by shanenin Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.