|
|||||||||||
|
Re: bash vs. python scripts - which one is better?
From: Bob Proulx <bob(at)proulx.com>
Date: Tue Aug 21 2007 - 19:50:53 EDT
I don't think there would be much performance difference but I have not benchmarked it. However I accept that 20 years ago it was included for that reason and that it may have been significant then. > vin:~> bash You are running afoul of -a ambiguity. Stop that. Do you mean AND such as -a intends? Use -e if you want to test for simple file existence. However most of the time it is better to use -f or -r or -x or whatever you are actually testing for. > I think that [ has been added as a builtin to the bash shell in order Test was added to the shell well before bash came along. > > But better to use the one = so that it is portable. I prefer using an I was talking traditional test style here. I break with tradition in my scripts and use _ instead of X so that they are lower profile. > Are you sure that POSIX defines this okay but as I was noting the traditional use was to use the X to prevent the old test from parsing it as an option. In the traditional environment this was not protected by the new POSIX requirement to count the number of program arguments provided. I still prefer to use -z and -n instead. Bob -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.orgReceived on Tue Aug 21 19:51:13 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 02:38:39 EDT |
||||||||||
|
|||||||||||