Search Results

Search: Posts Made By: vgersh99
25,404
Posted By vgersh99
ok, how about using find. To start with: ...
ok, how about using find. To start with:

find . \( -name '*.org' -o -name '*.texi' \) | xargs head
25,404
Posted By vgersh99
man head
man head
11,713
Posted By vgersh99
Ok, where exactly are stuck?
Ok, where exactly are stuck?
112,932
Posted By vgersh99
How about: echo ${#text1} ${#text2} | awk...
How about:
echo ${#text1} ${#text2} | awk '$1*$2{a=b=$1;($1>$2)?a=$2:b=$2;print int(100/a*b)}'
112,932
Posted By vgersh99
a bit simpler - the order doesn't matter: ...
a bit simpler - the order doesn't matter:

echo ${#text1} ${#text2} | awk '{a=b=$1;($1>$2)?a=$2:b=$2;print (100/a*b) }'
9,469
Posted By vgersh99
As always... what have you tried so far and where...
As always... what have you tried so far and where exactly are stuck?
18,369
Posted By vgersh99
the paradigm for the ksh/bash-like shells is: ...
the paradigm for the ksh/bash-like shells is:

myVar="$(executeMyCommandHere)"
107,159
Posted By vgersh99
I don't know what "other special characters"...
I don't know what "other special characters" means and I am not csh-savvy, but the following seem to work


#!/bin/csh

set uid = 'jij'
set a = `awk -v v2s="${uid}" '$2==v2s {print $3}'...
107,159
Posted By vgersh99
well, my condolences ;) you can adopt the...
well, my condolences ;)
you can adopt the ksh/bash approach to csh as well...
107,159
Posted By vgersh99
it's not a matterof the shell version. It's a...
it's not a matterof the shell version. It's a matter of using double-quotes when doing var assignment and (more importantly) when echo-ing the variable value.
See my initial response with colored...
107,159
Posted By vgersh99
ok, still no need for grep. val2search='jij'...
ok, still no need for grep.

val2search='jij'

a="$(awk -v v2s="${val2search}" '$2==v2s {print $3}' testfile)"
echo "$a"
107,159
Posted By vgersh99
you probably have a file named Qm6Pnw in the...
you probably have a file named Qm6Pnw in the direfctory you're running these commands in.
try:

a="$(awk '$2=="jij" {print $3}' testfile)"
echo "$a"
7,460
Posted By vgersh99
how about to start with - you can enhance it to...
how about to start with - you can enhance it to match ONLY 6 or 8 chars (not 6 though 8 including 7) - left as an exercise:
grep -iE '^#[a-f0-9]{6,8}$' colours.txt
7,460
Posted By vgersh99
I don't know either... Most likely because...
I don't know either...
Most likely because you're using Extended RegEx without telling grep to do so (-E)
could you provide a sample file and a desired output (as always)?
7,460
Posted By vgersh99
well... first, you'd need to define what makes...
well... first, you'd need to define what makes the code "invalid".
Them look at your "text file" and try to determine the logical pattern how to make the "call".
100,046
Posted By vgersh99
Are you saying you're logging in to each "device"...
Are you saying you're logging in to each "device" and running the script manually?
You think this would scale?
Why not to invest time/effort into automating this repetitive task?!
100,046
Posted By vgersh99
I don't follow... How creating a single script...
I don't follow... How creating a single script file will "create a lot more work" whether it gets run against one file/device or 50?
But if you insist:

#!/bin/ksh
awk '
{
idx=""
...
9,308
Posted By vgersh99
awk -F"," 'FNR==1{next}; ....'
awk -F"," 'FNR==1{next}; ....'
10,164
Posted By vgersh99
what have you done so far and where exactly are...
what have you done so far and where exactly are stuck?
have you searched for similar threads in these fora?
have you checked the 10 More Discussions You Might Find Interesting at the bottom of this...
70,660
Posted By vgersh99
echo 'A: a b c dA: e f g hA: i j k lA: m n o p' |...
echo 'A: a b c dA: e f g hA: i j k lA: m n o p' | sed 's/.:/\n&/g' | sed '/^$/d'
9,308
Posted By vgersh99
wouldn't FNR>1 do the job?
wouldn't FNR>1 do the job?
100,046
Posted By vgersh99
for simplicity sake.... create a file cham.awk...
for simplicity sake.... create a file cham.awk with the content as indicated in the post and execute the command line as indicated in the post.
There're other ways to execute what's been provided,...
100,046
Posted By vgersh99
a bit verbose (assuming 'drop' comes first),...
a bit verbose (assuming 'drop' comes first), but....
awk -f cham.awk ruleSetFile.txt where cham.awk is:

{
idx=""
slide=(/drop/)?2:1
for(i=1;i<=NF-slide;i++)
idx=(i==1)?$i:idx $i
}...
73,592
Posted By vgersh99
thumbelina, you'll have to debug your script...
thumbelina,
you'll have to debug your script (as you said) "taking it one step at a time" given the suggestions provided previously by RudyC and the others.
The best approach is to do the debugging...
73,592
Posted By vgersh99
change LOG="pdb.lg psmseis.lg psyseis.lg" to ...
change
LOG="pdb.lg psmseis.lg psyseis.lg"
to
LOG="{pdb.lg,psmseis.lg,psyseis.lg}"

Read up on Brace Expansion in your favorite shell's man page.

There're other issues with the script to...
Showing results 1 to 25 of 500

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