Search Results

Search: Posts Made By: xbin
441
Posted By xbin
Single bracket test matches strings not patterns....
Single bracket test matches strings not patterns. Use a case statement which allows pattern matching.

case $col2 in
*/*) do stuff
do more stuff
;;

*\"*) ...
Forum: OS X (Apple) 05-18-2017
1,304
Posted By xbin
This will place the window of the new instance of...
This will place the window of the new instance of the Terminal.app in front.

open -F -n -b com.apple.Terminal
Forum: OS X (Apple) 11-11-2016
2,948
Posted By xbin
Just exclude the .Trash directory in your find...
Just exclude the .Trash directory in your find statement.

find "$HOME" -path '*.Trash*' -prune -o \( -name sox -print \)
1,216
Posted By xbin
I would go though all these files and quote your...
I would go though all these files and quote your variables.
2,036
Posted By xbin
NFSv4 ACLs can to the job but that depends on...
NFSv4 ACLs can to the job but that depends on whether your OS supports them.
681
Posted By xbin
Use a case statement: read -r -p "Is this...
Use a case statement:


read -r -p "Is this correct? [yes/No] " response
case $response in
[yY] | [yY][Ee][Ss] )
do something
;;

[nN] | [n|N][O|o] )
echo...
6,703
Posted By xbin
What have you tried?
What have you tried?
793
Posted By xbin
Use ed: for file in *.txt do ...
Use ed:


for file in *.txt
do
printf "%s\n" 1i "geneID $file" . w | ed -s "$file"
done
3,726
Posted By xbin
I think you are looking for something like this ...
I think you are looking for something like this

x=0
while [ "$x" -le 12 ]
do date +'%Y%m' -d "$x month ago"
((x++))
done


Though this doesn't assign values to a variable. Does your...
860
Posted By xbin
Enclose the variable in strong and weak quotes. ...
Enclose the variable in strong and weak quotes.

sed '/'"$DB_Name"'\;/d' FILE
3,378
Posted By xbin
Using RE's search for the backlash character then...
Using RE's search for the backlash character then the following n character

sed 's/[\][n]/,/g' filename
1,040
Posted By xbin
Why not awk '/host/{print $0"\n"}'...
Why not
awk '/host/{print $0"\n"}' host.properties
or in sed
sed '/host/!d;G' host.properties

Of course there is no need to match a pattern if the file only needs double spacing.
1,040
Posted By xbin
To double space the file: sed G FILE
To double space the file:

sed G FILE
2,545
Posted By xbin
I counted 10 variable that are not defined. ...
I counted 10 variable that are not defined.


if [ ! -d $Dest ]
then
mkdir -p $Dest
fi


This test will fail if the last name in the path of Dest resolves to another file type. I would...
Forum: Programming 04-03-2015
1,189
Posted By xbin
If I understand your question correctly then a...
If I understand your question correctly then a good starting point would be

man hier
6,370
Posted By xbin
A variation of RudiC's solution that should work...
A variation of RudiC's solution that should work in OS X. If your file names have spaces in the name then

awk 'FNR==3 && /[a-z]*-[a-z]*-[a-z]*-/ {printf"%s\n", FILENAME}' file* | xargs -I {} echo...
Forum: Open Source 03-28-2015
7,654
Posted By xbin
You should read the INSTALL and README files...
You should read the INSTALL and README files before you attempt to compile open source software. You are missing the dependency lib.ICE- configure: error: Can't find libICE because configure cannot...
672
Posted By xbin
Phil Harvey's exiftool is a great tool for...
Phil Harvey's exiftool is a great tool for reading and writing metadata. It requires that you have perl installed. You may need to compile exiftool ( I'm not sure whether compiled binaries are...
537
Posted By xbin
I'm assuming that you are using a Bourne like...
I'm assuming that you are using a Bourne like shell. You could use parameter expansion.

filename=20150217-v1-PH_THOMSON_Reuters_Bangkok_Conceptual_Ready_P20_170215

filename=${filename%??_*} #...
Forum: OS X (Apple) 03-09-2015
1,986
Posted By xbin
I'm going to suggest that you start by editing...
I'm going to suggest that you start by editing your post. You should use proper capitalization and punctuation. Write your requests in complete sentences and check your grammar.
1,394
Posted By xbin
As a "one liner" this would look like scrambled...
As a "one liner" this would look like scrambled eggs.

awk '/AA|BB|CC/ {fcount++}
/XY|RS|PQ/ {scount++}
END { printf("%s\n%s\n",
"Type1 = " fcount, "Type2 = " scount)
...
1,616
Posted By xbin
Try the following-> sed '/.*_id...
Try the following->

sed '/.*_id .*/s/double/string/' FILE
15,816
Posted By xbin
You somewhat "jump through hoops" with csh. The...
You somewhat "jump through hoops" with csh. The following should work (tested in tcsh).

set v=`cat file`
set i=1
while ( $i < = $#v )
echo $v[$i]
@ i = $i + 1
end
6,637
Posted By xbin
Using BSD sed: substitute the carrage return...
Using BSD sed: substitute the carrage return character with nothing; terminate the last line of the file with the new-line character; remove any blank lines and save the results in a new file.

...
4,306
Posted By xbin
echo -n "${var1}," >> log_file . . echo -n...
echo -n "${var1}," >> log_file
.
.
echo -n "${var2}," >> log_file
.
.

or

printf "${var1}," >> log_file
.
.
printf "${var2}," >> log_file
Showing results 1 to 25 of 128

 

Featured Tech Videos

All times are GMT -4. The time now is 08:11 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy