Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 3 13
Impact
~46k people reached

  • 0 posts edited
  • 0 helpful flags
  • 8 votes cast
2h
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?
16h
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?
Apr
18
comment How to put fixed-width, vertically-oriented key-value pairs in a CSV file?
@awk_FTW The records lines OPERATION_CONTEXT ... All Attributes are not required. I just need the attributes which have an equal, with some attributes values which are in more than one line too. I need to make a check for each attribute to handle multiple lines in every attribute.
Dec
28
comment How to check the process along with its arguments in process list?
Thanks for the answer, after trying different ways, i finally chose the locking mechanism. I am applying a lock when a script is executed with some arguments and have given the name of the lock file <arg1_arg2> which i am deleting at the end of the script. This way i am able to have multiple instances of the script running with different arguments than the one already running and block multiple instances of the script with the same arguments so that the script is not executed twice with the arguments already being used in running instace which was my actual requirement.
Dec
28
comment How to check the process along with its arguments in process list?
Thanks a lot for the detailed and variety of ways to handle multiple instances.
Dec
25
comment How to check the process along with its arguments in process list?
I thought of using lock but i want to do this without creating any temporary files. Already i am using some temp files for the script.
Oct
19
comment How to put fixed-width, vertically-oriented key-value pairs in a CSV file?
@slm: No, it doen't matter whatever the order is.
Mar
19
comment Linux User not able to login
ok, I tried tail -f /var/log/secure and from another window i tried logging in to the ssh using the new username/pass and i can see the following messages: debug1: PAM: setting PAM_TTY to "ssh" debug1: temporarily_use_uid: 778/516 (e=0/0) debug1: trying public key file /home/tuser/.ssh/authorized_keys debug1: restore_uid: 0/0 debug1: temporarily_use_uid: 778/516 (e=0/0) debug1: trying public key file /home/tuser/.ssh/authorized_keys2 debug1: restore_uid: 0/0 Failed publickey for tuser from <ip_of_server> port 32352 ssh2
Mar
19
comment Linux User not able to login
The RHEL distribution is: Red Hat Enterprise Linux Server release 5.5 (Tikanga). I tried the ssh command and the same happens for it too, it take username and then hangs after i give password.
Mar
18
comment Linux User not able to login
I cannot see any /var/log/auth.log file. Ok, after changing the /etc/ssh/sshd_config LogLevel to DEBUG, i restarted sshd. I cannot see any auth.log file still.
Mar
17
comment Linux User not able to login
When i run ssh temipuser@<ip_of_server>, the same happens, it accepts username but hangs when i give password.