Search Results

Search: Posts Made By: say170
7,435
Posted By say170
Thanks for the spot. It didn't quite work...
Thanks for the spot.


It didn't quite work as you suggested, but when I added the echo back in, it worked. Many thanks:echo $a1 | ssh -q -i ~/.ssh/mysshkey remoteserver "sed -i '\%$a1%d'...
7,435
Posted By say170
Delete line from remote file over ssh passing variable
I have a variable called $a1 which maps to something like "http://servername proxy1 count http" and a lots of entries in a file on remote server.
If I have the following in my .sh script:
sed -i...
11,424
Posted By say170
Found a working solution here - shell - How can I...
Found a working solution here - shell - How can I use a variable in curl call within bash script - Stack Overflow...
11,424
Posted By say170
tried both ways. removed all my white spaces and...
tried both ways. removed all my white spaces and tried a variable. Here is a better code stub which shows the full data element.
...

json_data=$(printf...
11,424
Posted By say170
--data $(printf '{ "mName": "%s", ... ...
--data $(printf '{
"mName": "%s",
...
}
' "$mname")
================

{"message":"JSON parse error","statusCode":400}


:-(
11,424
Posted By say170
I'm trying - is there an alternative just in case...
I'm trying - is there an alternative just in case that doesn't with with our admins?
11,424
Posted By say170
You may have missed the quote in data. ...
You may have missed the quote in data.

--data '{If I remove that (and the quote at the end), and then put
"mName": "$mname",I get
./addclients.sh: line 20: mName: command not found :-(

...
11,424
Posted By say170
Curl not accepting spaces in script via variables
Hi All,


I'm trying to run a script which issues rest commands via curl to an endpoint. If I put spaces in fields via something like insomnia, it works, but when I try from an input file, it's...
2,160
Posted By say170
for info, I set -n 2000. 2250 failed.
for info, I set -n 2000. 2250 failed.
2,160
Posted By say170
no. unfortunately I have a variable amount of...
no. unfortunately I have a variable amount of files to process 3000-5000. This would mean adding a loop to copy in batches which is an ugly solution.
2,160
Posted By say170
The old box has: xargs --show-limits Your...
The old box has:
xargs --show-limits
Your environment variables take up 1231 bytes
POSIX lower and upper limits on argument length: 2048, 129024
Maximum length of command we could actually use:...
2,160
Posted By say170
Unexpected Argument list too long error on later os level
I have a script on RedHat which runs this:

ssh -q -t -i $HOME/.ssh/my_key server2 "find ~/toCopy/*data* | xargs sudo mv -f -t /home/files/"

I'm getting:
sudo: unable to execute /bin/mv:...
5,540
Posted By say170
Using read for input over ssh
Hi,

I'm using read in a script to prompt and receive input.

read -r -p "Do you also want to deploy folder? [y/N] " response

This works fine, however, if I remotely execute the same script...
4,570
Posted By say170
Highlighting specific column in cat/grep
I have a large * delimited text file and need to highlight specific columns on specific lines. The file looks similar to this:

ABC*01*00*01*00000 000000 *00000 000000 ...
4,749
Posted By say170
Check if file exists via ssh in ssh (nested)
I'm using redhat and have an odd issue with a nested ssh call.

ssh -i ~/.ssh/transfer-key -q transfer@fserver1 [[ -f /home/S/outbox/complete ]]
&& ssh -i ~/.ssh/transfer-key transfer@fserver1...
2,198
Posted By say170
I don't have ksh93, only straight ksh which...
I don't have ksh93, only straight ksh which returns

./csvsplit2.ksh[6]: : bad substitution---------- Post updated at 11:20 AM ---------- Previous update was at 10:28 AM ----------



I think...
2,198
Posted By say170
Linux (Redhat) reports as Linux hostname...
Linux (Redhat)

reports as
Linux hostname 2.6.9-104.ELsmp #1 SMP Wed May 9 19:42:36 EDT 2012 i686 i686 i386 GNU/LinuxI can use bash, ksh, or sh ...

the fork error was on cygwin, so you can...
2,198
Posted By say170
Datestamp format 2nd change in csv file (awk or sed)
I have a csv file formatted like this:

2014-08-21 18:06:26,A,B,12345,123,C,1232,26/08/14 18:07and I'm trying to change it to MM/DD/YYYY HH:MM for both occurances.
I have got this:
awk -F, 'NR...
1,017
Posted By say170
Variable substitution in array printing
Hi folks,

A really dumb question as I've wasted far too long trying to get this to work.... (on RH bash)

I have an array:

m0[1]='<hello>'
m0[2]='<there>'
m0[3]='<fred>'
...
1,515
Posted By say170
sh - parsing string into grep
I'm using sh under AIX 5.3 and after grep'ing, awk'ing, splitting a file, I end up with two variables as:
0123456 789Can these values be somehow passed into a grep as two different variables using...
1,112
Posted By say170
no, because as I said, I need to call it 10 times...
no, because as I said, I need to call it 10 times (as some lines have 10 entries, but some may have one). With the above, if I add perl -lane '$F[9]+=1000000;print join (" ",@F)' when there are only...
1,112
Posted By say170
Help with awk script and update position
Hi, I'm using AIX 5.3 and am trying to get this to work as I need:

echo 6078: 6072 6073 6074 6075 6076 6077 6078 6079 | awk '{n=$8} n{sub(n,n+1000000)}1'
1006078: 6072 6073 6074 6075 6076...
7,288
Posted By say170
great... thanks.. much easier. I have a follow...
great... thanks.. much easier. I have a follow on question. my real data is like this:

7004: 38706 38707 38708 38709 38710 38711 38712 38713
7005: 38904 38905 38906
I can add 1000000 to the...
7,288
Posted By say170
that doesn't work. The output is: 1234:...
that doesn't work. The output is:

1234: 1234 123 123 444 555 666 7777

---------- Post updated at 11:27 AM ---------- Previous update was at 10:37 AM ----------

figured it out myself...
7,288
Posted By say170
Colon in awk script output
I'm using AIX 5.3 and running a awk replace to modify data as follows:

echo 1234: 1234 123 123 444 555 666 7777 | awk '/^:/{split($2,N);n=N[1]} {n=$1} {sub(n,n+10000000)}1'

10001234 1234 123...
Showing results 1 to 25 of 36

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