Search Results

Search: Posts Made By: lost.identity
2,836
Posted By MadeInGermany
Put the umask command to the user's login files ...
Put the umask command to the user's login files
cd /home/shared
echo umask 002 >> .profile
echo umask 002 >> .login
2,836
Posted By RavinderSingh13
Hello, If I understand correctly, you can...
Hello,

If I understand correctly, you can use umask option here, as for giving permissions like 755,
we can use command like umask 002 so permissions will be set by the inverse of the umask...
1,058
Posted By Aia
Perhaps a heavily commented and hard coded...
Perhaps a heavily commented and hard coded example?

#!/usr/bin/perl

use strict;
use warnings;

my $in="file";

open my $fh, '<', $in or die "Could not read $in: $!\n";

# start reading...
1,674
Posted By MadeInGermany
awk '{print} NR==9{print "newline"}'...
awk '{print} NR==9{print "newline"}' file
1,674
Posted By Yoda
awk 'NR==10{print "line"}1' file
awk 'NR==10{print "line"}1' file
1,216
Posted By ctsgnb
Yes and... by the way the sed statement proposed...
Yes and... by the way the sed statement proposed by RavinderSingh13 also removed the dot in the numbers :

The expected :
723.187 2662.000
became
723187 2662000

which - i guess - is not...
1,216
Posted By Jotne
Your problem with this: awk...
Your problem with this: awk '/unburnt:.*burnt:/{Tu=$6;Tb=$NF}END{print Tu, Tb}' star.log is that you do the print in the END section. This will just print one instance.
Change it to:
awk...
1,216
Posted By ctsgnb
Did you try : awk '/unburnt:.*burnt:/{print $6,...
Did you try :
awk '/unburnt:.*burnt:/{print $6, $NF}' star.log
5,705
Posted By Don Cragun
Supposing that you have 1-3 digit user numbers,...
Supposing that you have 1-3 digit user numbers, you could also use:
awk '{print $2 }' ?.usr ??.usr ???.usr > data.txt
without needing to resort to sort and xargs. Obviously, you'll need more terms...
5,705
Posted By elixir_sinari
Don't blame awk. It's your shell doing the...
Don't blame awk. It's your shell doing the globbing in lexicographical order.

One way:
printf "%s\n" *.usr|sort -n|xargs awk '...'
9,725
Posted By RudiC
spacebar is right, but to fulfill your...
spacebar is right, but to fulfill your requirement of many files, you need to supply a number of files, like awk '...' DI*.DAT. Depending on your directory structure, you may want to use e.g. find to...
9,725
Posted By spacebar
You can 'print' your output found to a file, for...
You can 'print' your output found to a file, for example:
awk '/Sl.*thickness/ {Sl=$3;Tt=$NF}END{print FILENAME ":" Sl, Tt >> "data.out"}' DILAT.DAT
1,298
Posted By user8
Assuming that you are interested in the last...
Assuming that you are interested in the last field of rows containing "Thermal thickness"
awk '/Thermal thickness/ { Tt = $NF }'
1,174
Posted By Subbeh
Use single quotes to get these variables to work:...
Use single quotes to get these variables to work:
perl -i -pe '/open/&&s/t\d+_p\d+/t$ENV{'j'}_p$ENV{'i'}/' interp.f
1,174
Posted By Subbeh
export the variables and use $ENV{'i'} and...
export the variables and use $ENV{'i'} and $ENV{'j'} in your perl script.
1,298
Posted By user8
You can try: awk 'BEGIN{ print "sL0", "dL0",...
You can try:
awk 'BEGIN{ print "sL0", "dL0", "Tb","Tu"}/sL0.*dL0/{sL0=$3;dL0=$6}/Tb.*Tu/{ print sL0, dL0, $3,$6}'
1,032
Posted By rdcwayx
for i in {1..40}; do str=$(printf %05d $i)...
for i in {1..40};
do
str=$(printf %05d $i)
plot \'"t$str.dat"\' using 1:2
done
1,032
Posted By Scrutinizer
for file in t*.dat do plot "'$file'" ... ...
for file in t*.dat
do
plot "'$file'" ...
done
1,032
Posted By Yoda
How about:- printf "%s\n" t*.dat | sort | while...
How about:-
printf "%s\n" t*.dat | sort | while read file
do
plot '"$file"' using 1:2
done
4,442
Posted By Corona688
I've extrapolated your requirements as best I can...
I've extrapolated your requirements as best I can from the limited information. This should accomodate exponents to + or - 30 I hope. Requires the bash or ksh shell. It assumes the numbers are in...
4,442
Posted By Corona688
That is a useless use of ls *...
That is a useless use of ls * (http://partmaps.org/era/unix/award.html#ls) and useless use of backticks (http://partmaps.org/era/unix/award.html#backticks). You do not need ls to use *, that's the...
4,442
Posted By grep_me
try this: This will remove all the spaces and...
try this: This will remove all the spaces and replace it with an underscore and then rename them

ls -1 "t_ "* | while read filename ; do flnm=`echo "$filename" | tr -s " " "_"`; cp "$filename"...
4,442
Posted By itkamaraj
$ ls -1 | sort -k 1.4 | while read a; do...
$ ls -1 | sort -k 1.4 | while read a; do i=$((i+1));echo mv "$a" t${i}.dat; done
mv t_ 0.20000E-02.dat t1.dat
mv t_ 0.21000E-02.dat t2.dat
mv t_ 0.22000E-02.dat t3.dat



if you are happy with...
2,311
Posted By clx
Give a try.. find . -name '*.pdf' -type f |...
Give a try..
find . -name '*.pdf' -type f | while read FILE
do
pdftotext $FILE | grep -q "search phrase"
[ $? -eq 0 ] && echo $FILE
done
2,311
Posted By Don Cragun
If you create a file named grepPDF containing: ...
If you create a file named grepPDF containing:
#!/bin/ksh
for i in "$@"
do
pdftotext "$i" - | grep 'search phrase' > grepPDF.$$ && \
printf "\nFollowing lines are in...
Showing results 1 to 25 of 49

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