Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: alister
Forum: Ubuntu 05-24-2014
2,291
Posted By alister
Just in case, note that the OP specified...
Just in case, note that the OP specified sendemail, not sendmail. Perhaps it's a typo, but there is such a program and it is available via ubuntu's package repositories.
...
1,193
Posted By alister
Polling the folder and hoping that everything is...
Polling the folder and hoping that everything is done is asking for trouble. If you actually care about not copying over a half-written file, you need an atomic step.

First of all, the directory...
1,660
Posted By alister
If the file uses a tab delimiter and there is...
If the file uses a tab delimiter and there is only 1 per line:
sed 's/\./\t/3; s/\t.*\t/\t/' file
That isn't portable sed, because \t is primarily a GNU extension. However, if it worked for you,...
Forum: Programming 05-23-2014
2,141
Posted By alister
CS and DS do not need a type member. Whenever CS...
CS and DS do not need a type member. Whenever CS and DS are being used directly, the code using them already knows what they are. Only ignorant code inspecting the union needs access to a type flag....
853
Posted By alister
If you are using bash, and if there's no...
If you are using bash, and if there's no bash-specific code, try dash or ksh93. Bash isn't an efficient shell.

We can't possibly make any targeted recommendations without knowing something about...
5,524
Posted By alister
If this task is performed regularly, you should...
If this task is performed regularly, you should consider using a dedicated filesystem. When the time comes to wipe it, instead of rm use mkfs (or newfs, or whatever tool your system uses to create a...
10,271
Posted By alister
echo is usually a shell built-in and not subject...
echo is usually a shell built-in and not subject to that limit.

Regards,
Alister
5,055
Posted By alister
AWK's arrays are associative and its subscripts...
AWK's arrays are associative and its subscripts are strings. i does pop into existence, but, in that string context, its undefined value is converted to an empty string.

awk 'BEGIN { a[i]=5; print...
1,405
Posted By alister
For a numeric sort, there's no need to remove...
For a numeric sort, there's no need to remove leading zeroes.

Regards,
Alister
3,669
Posted By alister
Two things. First, the -c option, which...
Two things. First, the -c option, which complements [:alpha:], so what is matched is everything that is not a member of [:alpha:].

Second, \n* must be bracketed. With the brackets, it represents...
Forum: High Performance Computing 05-10-2014
4,559
Posted By alister
Welcome to the forum. Your post is devoid of...
Welcome to the forum.

Your post is devoid of specifics, so don't expect much targeted advice.

Are you using the CPUID instruction to detect AVX? That should work. For the specifics, there are...
1,041
Posted By alister
Professor? This should probably have been in the...
Professor? This should probably have been in the homework forum.

Seems a "classmate" has showed up with the same data.

Regards,
Alister
726
Posted By alister
It seems like your friend posted here as well,...
It seems like your friend posted here as well, https://www.unix.com/shell-programming-and-scripting/247112-help-sed-command.html

What a coincidence. For the sake of your projects, you should both...
5,190
Posted By alister
Nevermind me. I didn't register the "next". ...
Nevermind me. I didn't register the "next".

Regards,
Alister

---------- Post updated at 07:35 PM ---------- Previous update was at 06:59 PM ----------


You are correct in correcting me;...
5,190
Posted By alister
After re-reading the OP's previous two posts, I'm...
After re-reading the OP's previous two posts, I'm not certain if I correctly understood the task. If I am mistaken, apologies for the noise.

What I have in mind is the following scenario:

1...
1,325
Posted By alister
As far as I'm concerned, unless you demonstrate...
As far as I'm concerned, unless you demonstrate that you have put forth some effort to solve your own problem, you can continue to wait.

We are here to help, but we are not a free, script-writing...
1,483
Posted By alister
Another, slightly simpler, sed alternative: ...
Another, slightly simpler, sed alternative:

sed 's/.*(//; s/).*//' file
Forum: Red Hat 05-08-2014
2,676
Posted By alister
Even if you set that up correctly, on your...
Even if you set that up correctly, on your system, according to the diagnostic message, mkdir isn't under the /usr hierarchy.

More importantly, as I said, there are multiple errors in your attempt...
5,190
Posted By alister
Since the strings tested aren't regular...
Since the strings tested aren't regular expressions, using the regular expression operator is, at best, unnecessarily expensive. At worst, if the strings are allowed to contain regular expression...
794
Posted By alister
You can group them with { ... ; } or ( ... ) or...
You can group them with { ... ; } or ( ... ) or you can use exec.

Regards,
Alister
3,596
Posted By alister
If the following script is problems.sh: ...
If the following script is problems.sh:

mkdir newdir && cd newdir

cat <<EOF > file.txt
*.txt


a b .txt
EOF

echo BEGIN CORRECT SOLUTION
sed 's/\.txt$/_'$(date +%m%Y)'&/' file.txt...
9,922
Posted By alister
If we are going to be precise with regard to...
If we are going to be precise with regard to formal language theory, then you are mistaken. Neither POSIX Basic Regular Expressions, nor the "extended" dialects implemented in perl, python, php,...
3,596
Posted By alister
A simple sed solution: sed...
A simple sed solution:

sed 's/\.txt$/_'$(date +%m%Y)'&/'

Regards,
Alister

---------- Post updated at 12:31 PM ---------- Previous update was at 12:19 PM ----------


That's an extremely...
9,922
Posted By alister
That code is vulnerable to pattern matching...
That code is vulnerable to pattern matching metacharacters. For this approach to work with arbitrary text, it is necessary to double-quote the nested parameter expansion.

$ s=*****a
$ echo "$s"...
16,769
Posted By alister
That's not quite right. Both instances of *.*...
That's not quite right. Both instances of *.* should be *..

Regards,
Alister
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 05:32 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy