Search Results

Search: Posts Made By: senhia83
5,795
Posted By vgersh99
Good point, Don. I thought executing echo...
Good point, Don.
I thought executing echo $(pwd) (as it's not a variable, but rather an active function) through ssh on a remote system, would return the output of command pwd from the remote,...
5,795
Posted By Don Cragun
Not quite. The echoed value shown in red above...
Not quite. The echoed value shown in red above is also from the local shell; not the shell running on serverB.xxx.org. And, in Bourne based shells, the current working directory is stored in the...
5,795
Posted By RudiC
As explained, try the other way round. And, set...
As explained, try the other way round. And, set the -x (--xtrace) option on the remote so you can see what happens.
5,795
Posted By bakunin
If i get that right: You have a server onto...
If i get that right:

You have a server onto which you want to log on using a certain user. If you connect from host A you want the user, after logging in, to go to one certain directory, if you...
5,795
Posted By Neo
When I set up pipeline processes using ssh, I...
When I set up pipeline processes using ssh, I always use ssh without passwords by just exchanging public and private key pairs... (a one time setup, but saves a lot of time and effort afterwards)
...
5,795
Posted By vgersh99
shouldn't it be this way: ...
shouldn't it be this way:

workdirremote='/My/Intended/Path/'
sshpass -p password ssh userid@serverB.xxx.org << ENDSSH
cd ${workdirremote}
echo $(pwd)
ENDSSH
5,795
Posted By Neo
It's easiest to simply add a line of code in your...
It's easiest to simply add a line of code in your home directory .profile file which changes the directory to the directly you wish after you login.

So, just add this to the bottom of your...
5,795
Posted By RudiC
Why doesn't it do what you want / need? Where...
Why doesn't it do what you want / need? Where does it fail?
942
Posted By RudiC
One approach might be to first check for the...
One approach might be to first check for the longest signals and break if matched. My mawk doesn't offer a sort function, so falling back to the *nix sort command piping into an adaption of your...
1,379
Posted By RudiC
https://www.unix.com/images/editor/separator.gifI'...
https://www.unix.com/images/editor/separator.gifI'm afraid I missed the leading counter. Try
awk '
NR > 1 {if (!(a[$3,$4])) {if (a[$4,$3]) {X = $4
...
1,379
Posted By Chubler_XL
Another option using sort: awk ' { if...
Another option using sort:

awk '
{
if (!(a[$3,$4]) && a[$4,$3]) {
X = $4
$4 = $3
$3 = X
}
if (!(a[$3,$4])) a[$3,$4]=++grp;
$1=a[$3,$4] FS $1
} 1 ' infile | sort -d
1,379
Posted By vgersh99
I think you have made a mistake in your desired...
I think you have made a mistake in your desired output based on your sample input.
here's another alternative - a bit verbose, but....
awk -f sen.awk myFile where sen.awk is:

{ g=(($3>$4)?($4...
1,379
Posted By RudiC
Try awk ' {if (!(a[$3,$4])) {if...
Try
awk '
{if (!(a[$3,$4])) {if (a[$4,$3]) {X = $4
$4 = $3
$3 = X
...
2,012
Posted By disedorgue
Hi senhia83, maybe a little bit faster than...
Hi senhia83,
maybe a little bit faster than your second solution:
awk 'NR==1 {C=NF;Y=$0;Z=$4;next}{X[NR]=$0;print Z,$1"__"$2"__"$3,$4}END{for(i=5;i<C;++i){$0=Y;Z=$i;j=1;while(++j<=NR){$0=X[j];print...
2,012
Posted By ctsgnb
Whatever strategy you choose, according to your...
Whatever strategy you choose, according to your expectation, you will get an output file that is near 5 times bigger than your input file.

input file :
rows = 400k
columns = 3000
Total amount...
2,012
Posted By MadeInGermany
Interesting idea! Let the filesystem do a part of...
Interesting idea! Let the filesystem do a part of the sorting, and let ls sort the other parts.
More fine-tuned so ls sorts less:
outdir=./output
mkdir -p $outdir
awk '
NR==1 {
for (i=4;...
2,012
Posted By rdrtx1
rm -rf output mkdir output awk ' NR==1 {...
rm -rf output
mkdir output
awk '
NR==1 { for (i=1; i<=NF; i++) a[i]=$i ;}
NR > 1 {
for (i=4; i<=NF; i++) print "touch output/\"" a[i], $1 "__" $2 "__" $3, $i "\"";
}
' infile | sh

ls -1...
2,307
Posted By Don Cragun
With your sample data, the following seems to do...
With your sample data, the following seems to do what you want fairly efficiently:
awk -F// -v OFS="\t\t" '
BEGIN { M = 0
m = 32000
}
FNR == NR {
if((l = length($0)) in pat) {
pat[l] =...
2,307
Posted By Don Cragun
You state that the desired match for the input: ...
You state that the desired match for the input:
(\\b-[pt22dx]dfdfs/(dsgfspp22dx//[(\pp22dx)-@@----B-@--
is pp22dx instead of pp22 because pp22dx is longer. But why isn't pt22dx just as valid as...
2,307
Posted By RudiC
Stealing from and simplifying Don Cragun's...
Stealing from and simplifying Don Cragun's approach - try
awk -F// -v OFS="\t\t" '
FNR == NR {l = length($0)
pat[l] = pat[l] DL[l] $0
DL[l] = "|"
...
4,079
Posted By drl
Hi. At our shop, we often try to generalize...
Hi.

At our shop, we often try to generalize problem solutions, rather than having a number of separate solutions for similar problems.

In this kind of case we created a code gate to handle...
4,079
Posted By rdrtx1
column=5 rm -f *_testcase.csv (( acol =...
column=5

rm -f *_testcase.csv
(( acol = column - 1 ))
while read line
do
[[ -z "$line1" ]] && { line1=$line ; continue ; }
IFS=, cols=($line)
fl=${cols[$acol]}${yr}__testcase.csv
...
4,079
Posted By RudiC
The output is redirected to the respective file,...
The output is redirected to the respective file, controlled by $5, as requested in post#1. If a new (i.e. not yet registered) $5 shows up in a line, the new file name is constructed in FN[$5], and...
4,079
Posted By RudiC
Try also awk ' NR==1 {HD = $0 ...
Try also
awk '
NR==1 {HD = $0
next
}

!FN[$5] {FN[$5] = $5 "2016__testcase.csv"
print HD > FN[$5]
}

{print $0 > FN[$5]
}
' FS=","...
4,079
Posted By RavinderSingh13
Hello senhia83, Could you please try...
Hello senhia83,

Could you please try following and let me know if this helps you(though honestly saying I am not completly sure about your query).

awk -F, 'NR==1{print >...
Showing results 1 to 25 of 78

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