Reputation
318
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 5 13
Impact
~50k people reached

  • 0 posts edited
  • 0 helpful flags
  • 9 votes cast
Aug
26
comment How to extract specific file(s) from tar.gz
I would like to add a point here, the -z option doesn't work in some versions of unix like HP-UX.
Aug
20
comment Huge delay in script response when using SFTP with expect
Thanks buddy, the ConnectTimeout=20 somehow didn't work for me, i waited and the connection never got timed out even after couple of minutes. However, i tried the second option -o NumberOfPasswordPrompts=2 which worked like a charm and solved my issue. Could you suggest why the Timeout didn't work? I mean something keeps holding the timeout option back from getting used during connection.
Aug
20
comment Huge delay in script response when using SFTP with expect
Thanks, What is 20 here? 20 seconds? If i give -o ConnectTimeout=20, will it disconnect the session even if some transfer is going on?
Aug
20
comment Huge delay in script response when using SFTP with expect
Want to update one point here, the SFTP operations are completed withing 30-35 seconds for a single server (same for all other servers whose details are updated in the credentials file) to copy the files to the local machine.
Aug
7
comment How to sum column values for each row in two csv files using bash script?
Why do we need this ; in print statement?
Aug
7
comment How to sum column values for each row in two csv files using bash script?
Sure. Thanks for your answer Neuron.
Aug
4
comment Why won't my FTP script get all the files using mget command?
I think it should report error if it doesn't find the end. It was not reporting any error.
Aug
4
comment Why won't my FTP script get all the files using mget command?
Thanks for the pointer Jeff. It was the same problem what you highlighted. I tried putting some 'y' under the mget and it fetched the files the number of time i put 'y'. This was really weird but it worked for me at least.
Aug
3
comment Why won't my FTP script get all the files using mget command?
I have defined the date variable above this code snippet.
Aug
3
comment How to use cp command in bash script to copy files with spaces ans $ characters in it?
Thanks a lot. This one worked. However, i used just cp "$TRX_SOURCE_PATH"/*TRX* "$DEST_PATH". Could you please explain the significance of -- here?
Aug
2
comment How to use cp command in bash script to copy files with spaces ans $ characters in it?
The answer mentions to use quotes for the variable which i am already using and it won't work.
Jul
24
comment How to rename all files with special characters and spaces in a directory?
It doesn't give anything, no output, no error. It just lands on next command line.
Jul
23
comment How to extract column name (header) from a CSV file which contains the max value in a row?
Could you please suggest the way in bash script or the changes in my awk for the same?
Jul
23
comment How to extract column name (header) from a CSV file which contains the max value in a row?
Along with the column name, how can i print the column value also i.e, if the max value is in column 5, it should print 5.
Jul
17
comment How to rename all files with special characters and spaces in a directory?
I tried all the three without -n option and still it won't change the name of the file. I doesn't give any error for any of the 3 types mentioned above. Maybe the rename command doesn't work for some reason. Is there any other way to change all the files in a directory with spaces or $ or @ in their names?
Jul
16
comment How can i use multiple if statement inside another if statement of a awk program?
Thanks a lot Gary and Gilles for your inputs. I will try this. One more question here, in the last condition, (!match $1, "-") Is this going to ignore all the values in column 1 where value conatins a _ ex: BTS_101, BSC_505 etc? and the hopefully the last print statement prints the entire CSV file data after filtering all the above conditions in the input CSV file?
Jul
14
comment How to parse a CSV file based with groups made of specific number of rows?
Also, is there a way to replace the datamash sum command with the general command where i can replace the sum operation with any other operation i want to perform? I have the requirement to perform various operations (like sum, average, calculate formulas) on the column values in each row in the CSV file which has multiple counter values in it. With the awk command you mentioned, i was able to repeat the date values in the empty columns which will really be useful to me.
Jul
14
comment How to parse a CSV file based with groups made of specific number of rows?
Thanks Icd047, i partially achieved what i wanted to get here. Could you please explain a little bit about this awk command awk -F, -v OFS=, '{ if($1 ~ /^[ \t]*$/) $1 = old; else old = $1 } 1' Actually i am a novice to scripting and awk and if you could break this command and explain what it is doing, it would be really helpful for me in the future.
Apr
29
comment How to put fixed-width, vertically-oriented key-value pairs in a CSV file?
@JosephR. Yes Joseph, it will.
Apr
18
comment How to put fixed-width, vertically-oriented key-value pairs in a CSV file?
@JosephR. More than a single " is very much possible in any attribute. How can we handle that?