Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 3309

Questions about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.).

1
vote
The problem, really, is that you should be doing proper option parsing. It looks like maybe you don't know how, but there's no shame in that. Using bash's built in option parsing, and properly quotin …
answered Feb 25 '14 by bahamat
4
votes
Should be: for i in *.tab do echo item: $i ogr2ogr -f "PostgreSQL" -s_srs "EPSG:21781" -t_srs "EPSG:4326" -overwrite -nln "$TBL_NAME" PG:"host=localhost user=\'${DBUSER}\' dbname=\'${DBNAME}\'" …
answered Sep 4 '12 by bahamat
8
votes
You've got a very good start by typing it all into one place. Copy all of that into a text file (e.g., workflow.sh, but the name doesn't really matter) then put this on the very first line of the fil …
answered Jun 27 '12 by bahamat
3
votes
I had to tackle this same problem a couple of weeks ago. pgrep and pkill support extended regular expressions so it's a simple matter of getting the right regexp. This is your script with the regexp …
answered Aug 29 '12 by bahamat
9
votes
If you want either then you want OR, not AND. if [[ ! -f /etc/benchmarking/code ]] || [[ ! -f /etc/benchmarking/code.class ]]; then echo "match" fi This will match if either or both files are mis …
answered Sep 13 '12 by bahamat
193
votes
If you want to say OR use double pipe (||). if [ "$fname" = "a.txt" ] || [ "$fname" = "c.txt" ] (The original OP code using | was simply piping the output of the left side to the right side, in the …
answered Sep 8 '12 by bahamat
3
votes
You need to have the following block at the head of your file: ### BEGIN INIT INFO # Provides: scriptname # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # De …
answered May 7 '15 by bahamat
3
votes
Firstly, you not only have to split the MAC and insert ff:fe, you also need to flip the 7th bit to correctly represent a universal/local address. This script will correctly format a link-local IPv6 a …
answered Jun 14 '13 by bahamat
5
votes
You should never install files into home directories with packages. Instead, you can install default configuration files to /etc/skel so that new users created after your package is installed will ha …
answered Jan 28 '15 by bahamat
6
votes
-ne only means "not equal" when it's in an if [ … ] statement. In this case -ne is an option to echo. You could just as easily use -en. From bash(1): If -n is specified, the trailing newline …
answered Sep 20 '11 by bahamat
2
votes
The join utility performs an "equality join" on the specified files and writes the result to the standard output. The "join field" is the field in each file by which the files are compared. In other …
answered Jan 25 '14 by bahamat
14
votes
This question appears to be answered already, but I think there's a better solution. Rather than tail | whatever, I think what you really want is swatch. Swatch is a program designed explicitly for d …
answered May 16 '11 by bahamat
1
vote
If you're doing this with filenames, use the basename command: $ basename $HOME/Documents/test/one.txt one.txt Further: $ FILE=$(basename basename $HOME/Documents/test/one.txt) $ echo $FILE one.tx …
answered Oct 9 '13 by bahamat
-1
votes
Is there any particular reason you couldn't call sed from within your ksh script? This simple script: #!/bin/ksh foo="left ' right" echo $foo foo=$(echo "$foo" | sed "s#\'#\'\'#g") echo $foo give …
answered Aug 3 '11 by bahamat
4
votes
As with anything, the more readable and understandable your code the easier it is for others (or future you) to maintain. When you have a choice and one of them is ambiguous, choose the other. Additi …
answered Jun 26 '13 by bahamat

15 30 50 per page