Search Results

Search: Posts Made By: Daniel Gate
3,129
Posted By Corona688
su does not work that way, it does not run the...
su does not work that way, it does not run the lines after it when you put it in a shell script and does not belong in a script.

If you want to login without a password to run a command, configure...
5,521
Posted By RudiC
It won't be the latest but the largest file. ...
It won't be the latest but the largest file.

Do you NEED to run that with sh? Does your system have the stat (or equivalent) command?

---------- Post updated at 22:58 ---------- Previous update...
3,456
Posted By MadeInGermany
No, this option is in GNU cp/coreutils version 8 ...
No, this option is in GNU cp/coreutils version 8
man cp
...
-n, --no-clobber
do not overwrite an existing file (overrides a previous -i option)
...
3,456
Posted By RudiC
I think Scott was talking of the shell's...
I think Scott was talking of the shell's noclobber option which works on redirections but not for cp.
3,456
Posted By MadeInGermany
Another possibility: rsync --ignore-existing...
Another possibility:
rsync --ignore-existing /p2/arch/log/* /p2/bkp/
3,456
Posted By Don Cragun
Assuming that you just want to copy files from...
Assuming that you just want to copy files from the directory /p2/arch/log (and not from subdirectories of that directory), you could try something like the following. It is untested, but should come...
3,456
Posted By Scott
Hi. You can use the -n or --no-clobber...
Hi.

You can use the -n or --no-clobber options.
1,274
Posted By junior-helper
Daniel, is it the output of the find command? I...
Daniel,
is it the output of the find command? I ask this because the biggest file is ~10MB.

You mentioned UNIX 6.1, did you mean AIX 6.1? If so, then try:
find /opt -type f -size +100000000c...
1,274
Posted By jim mcnamara
find /opt -type f -size +100M -exec ls -l {} \;
find /opt -type f -size +100M -exec ls -l {} \;
1,528
Posted By ongoto
Awk is great. Bash trys... #!/bin/bash ...
Awk is great.

Bash trys...
#!/bin/bash

while read x
do
[[ $x =~ ^Q ]] && ttl=${x##*'['}
[[ $x =~ ^"max queue depth" ]] && printf "%s %s\n" ${ttl%]*} ${x##*:}
done < ./queue.txt
1,528
Posted By junior-helper
jim, nice and clear approach :b: I guess...
jim,
nice and clear approach :b:
I guess print $3 should be print $5, because $3 is "depth" in the particular line.
1,528
Posted By RavinderSingh13
Hello Daniel Gate, Following may help you...
Hello Daniel Gate,

Following may help you in same too.


awk -F":" '/^Queue/ {gsub(/.*\[/,X,$0);gsub(/\].*/,Y,$0);S=$0;A=1} {if(A && ($0 ~ /max queue depth/)){print S OFS $2;A=0}}' ...
1,528
Posted By jim mcnamara
One way with awk and tr: awk ' /^Queue/...
One way with awk and tr:

awk ' /^Queue/ {printf ("%s ", $2)}
/max queue depth/ {print $3} ' infile | tr -d '[:punct:]' > newfile



On solaris use nawk and /usr/xpg4/bin/tr
2,448
Posted By junior-helper
Yes, it is incorrect. I think you are confusing...
Yes, it is incorrect. I think you are confusing scp with rsync. scp does not support the exclude-from feature.

Some of the additional features of rsync are:

o support for...
1,605
Posted By Chubler_XL
Just use the sort command: nawk '$1=="Date"...
Just use the sort command:

nawk '$1=="Date" {d=$(NF-2);next} $1=="Queue" {q=$NF;next} $1=="Forms"{print q, $NF, d}' OFS='|' | sort -t\| -k1,1 -k3,3

Edit: BTW 3rd column isn't date and time it's...
1,646
Posted By Yoda
Using strings and awk: strings file | awk ' ...
Using strings and awk:
strings file | awk '
/SleeperThreadAborting/ {
v = $0
if ( v !~ /\}\}$/ )
{
getline
...
17,491
Posted By Peasant
Here is an alternative way with no pipe : ...
Here is an alternative way with no pipe :

ssh root@ahcaxdbmil1c "cat >> /usr/local/system/scripts/myout.txt" < /usr/local/system/scripts/myout.txt
17,491
Posted By jim mcnamara
If you have ssh keys set up: /usr/bin/cat...
If you have ssh keys set up:


/usr/bin/cat somefile | ssh remotenode '/usr/bin/cat - >> /path/to/anotherfile'


Warning: Try this on junk files first. Or make backups of the real files first.
2,152
Posted By Scrutinizer
This file contains command output and then...
This file contains command output and then typically the order within a record will be maintained. The alternative would be to fill 4 separate files with 4 separate greps and then paste those files....
2,152
Posted By RudiC
Be careful: different from using 4 greps in a...
Be careful: different from using 4 greps in a sequence, using one grep with 4 expressions does not guarantee the order of output elements that the requestor perhaps wants.
2,152
Posted By Scrutinizer
Try: grep -e "Done" -e "Elapsed processing...
Try:
grep -e "Done" -e "Elapsed processing time:" -e "Client date/time:" -e "Total number of bytes transferred:" /tmp/dsmc.out | paste - - - -
2,152
Posted By vidyadhar85
You mean the outputs? also dont use cat when you...
You mean the outputs? also dont use cat when you are using grep/sed/awk they are capable of reading the file..
2,152
Posted By krishmaths
paste command
Try the paste command to place the output horizontally
1,505
Posted By Scrutinizer
You could make a quick adaptation of the script...
You could make a quick adaptation of the script by leaving out the exit 1 return code and instead of:
m=$0
exit 1

Use
m=""
print
next
1,505
Posted By Scrutinizer
Try: $i~/\=\=/
Try:
$i~/\=\=/
Showing results 1 to 25 of 91

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