Search Results

Search: Posts Made By: stevensw
1,162
Posted By Yoda
You can use an if condition to check if length of...
You can use an if condition to check if length of col2 is greater than 59 chars and print accordingly:-
if [ ${#col2} -gt 59 ]
then
# print next line
else
# print same line
fi
1,635
Posted By Yoda
perl -e 'use POSIX qw/strftime/; @x = split /\//,...
perl -e 'use POSIX qw/strftime/; @x = split /\//, $ARGV[0]; print strftime("%m/%d/%y",localtime)'
2,386
Posted By jim mcnamara
assuming that sendmail -t $tmp does work to send...
assuming that sendmail -t $tmp does work to send email. I do not see where the $uid variable gets used to address email. Oh well.
bash or ksh example using your code fragment:

#!/bin/bash...
5,074
Posted By alister
A dozen descriptors isn't very many. I'd just...
A dozen descriptors isn't very many. I'd just keep them open.

Regards,
Alister
4,980
Posted By Neo
<?php $date = date(); echo "Today's date is...
<?php
$date = date();
echo "Today's date is $date";
?>


Note the double quotes. PHP will evaluate the variable in strings with double quotes (not single quotes).
3,248
Posted By Corona688
Ah, so command1 command2 command3 must be...
Ah, so command1 command2 command3 must be executed sequentially, but the different instances can go in parallel.

for X in 1 2 3 4 5
do
( command1 ; command2 ; command3 ) &
done

wait...
3,248
Posted By jim mcnamara
Use the taskset command. You need some privilege...
Use the taskset command. You need some privilege to use it.

The syntax is:

for i in something
do
taskset [cpumask] command $i &
taskset [cpumask] command2 $i &
taskset [cpumask] ...
3,248
Posted By Corona688
That's decided by the operating system. You run...
That's decided by the operating system. You run n commands simultaneously and if there's enough CPU's, it will run them concurrently.

for X in 1 2 3 4 5
do
command &
done

wait

...
1,957
Posted By Chubler_XL
Try this: find . -maxdepth 1 -type d...
Try this:

find . -maxdepth 1 -type d -print0 | xargs -0 -n 1 du -hs | while read SIZE FILE
do
echo "$FILE" "[$SIZE]"
done
1,957
Posted By Corona688
Okay. find . -maxdepth 1 | xargs -I {} du...
Okay.

find . -maxdepth 1 | xargs -I {} du -hs | while read SIZE FILE
do
echo "$FILE" "[$SIZE]"
done
1,305
Posted By Scrutinizer
Do you mean fuser?
Do you mean fuser?
1,363
Posted By Yeaboem
just supply the filename(s) that exactly match...
just supply the filename(s) that exactly match names inside the tarball on your tar -x argument list.
e.g.

$ gzcat foo.tgz | tar -xf - exact/path/to/filename1
2,468
Posted By shamrock
Assuming that's the posted input try this... ...
Assuming that's the posted input try this...
sort -k6,6nr file
6,110
Posted By agama
Try adding the regex type option: find / ...
Try adding the regex type option:


find / -regextype posix-egrep -regex "/.{0,50}.*" -maxdepth 1


According to the man page on my system (SuSE) the default is emacs. I'm not sure how emacs...
3,517
Posted By alister
$ re_pattern="'.*\.c\$'" $ re_args='\! -regex...
$ re_pattern="'.*\.c\$'"
$ re_args='\! -regex '"$re_pattern"
$ eval find . "$re_args" -type f
... <my list of non-C source files here> ...
3,143
Posted By shamrock
How about a nested find command... find...
How about a nested find command...
find start_dir -name "dirname_regexp" -type d -exec find {} -name "somefile" \;
3,143
Posted By Corona688
If you have Linux, the -regex option is...
If you have Linux, the -regex option is available, but not with standard find, no.

You could also just pipe its output through egrep which should be able to handle it fine.
2,459
Posted By Corona688
The find command can do what you want, pretty...
The find command can do what you want, pretty sure.

$ find /path/to/dir/ '!' -user validuser
/path/to/dir/inside/filenotbelongingtovaliduser
...
$
3,951
Posted By Corona688
Putting it in quotes causes it to pass it as one...
Putting it in quotes causes it to pass it as one single argument. It's not perl that has to understand the newlines, it's the shell.

Keeping everything as one giant string like that is subject to...
Showing results 1 to 19 of 19

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