Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: jaysunn
7,028
Posted By jaysunn
Maybe a start using this: jaysunn-> cat...
Maybe a start using this:

jaysunn-> cat sub.sh
#!/bin/bash
STRING1='a-very-very-very-long-crazy-filename.jpg'

for i in $STRING1
do
echo "PROCESSING: ${i:0:14}..."...
1,377
Posted By jaysunn
Perhaps using AWK? You mentioned shell, AWK is...
Perhaps using AWK? You mentioned shell, AWK is external, not sure if this will work for you.

jaysunn-> awk '{print $1 * $2}' <<< '1.0E-05 5.0E-03'
5e-08
2,073
Posted By jaysunn
Perhaps something like this, it's not...
Perhaps something like this, it's not interactive, however it achieves what you want with test FQDN's that you can change to your IP's.


jaysunn-> cat ping_test.sh
#!/bin/bash
...
7,052
Posted By jaysunn
Sounds like python is looking for an INT instead...
Sounds like python is looking for an INT instead of STRING, perhaps you can convert them via the int() call. Just a suggestion, or vice versa and it needs an STRING try converting with the str()...
7,052
Posted By jaysunn
DISCLAIMER, I am learning PYTHON as well. Just a...
DISCLAIMER, I am learning PYTHON as well. Just a thought try the following for variable expansion.

Change red in all string expansions:
if gsm_att <= "0.5":
print "OK - GSM Attach KPI is...
7,052
Posted By jaysunn
@infinitydon, I believe your script failed at...
@infinitydon,
I believe your script failed at first cause the sys.argv[0] contains the actual script name itself, python utilizes 0,1,2,3 as arguments.

jaysunn-> cat pytest.py
import sys...
3,084
Posted By jaysunn
@whizkidash This may be your problem,...
@whizkidash


This may be your problem, highlighted in red, I tested your command and it works on RHEL6.

ssh <remote machine name> 'bash-s' < 'my script' Remove the space between the hand dash...
1,154
Posted By jaysunn
I believe it opens the file only once, I ran: ...
I believe it opens the file only once, I ran:

[root@WATCHKICK ~]# strace sed -e 's/WEND/W_END/' -e 's/CLOSE/C_LOSE/' f.txt > strace_out.txt 2>&1And then grepped for the filename which only...
1,154
Posted By jaysunn
Maybe something like this, I am sure a much more...
Maybe something like this, I am sure a much more elegant solution will appear.

[root@WATCHKICK ~]# cat f.txt
WEND
CLOSE
[root@WATCHKICK ~]# sed -e 's/WEND/W_END/' -e 's/CLOSE/C_LOSE/' f.txt ...
956
Posted By jaysunn
Maybe try this: jasonralph-> cat...
Maybe try this:

jasonralph-> cat test_file.txt
ABC25160|51497|06/02/2010|$32,192.07|MARK|$100|A
ABC08053|95149|06/02/2010|$47,904.95|TIM|$100|A...
915
Posted By jaysunn
Thanks to your replies, I ended up using the \$...
Thanks to your replies, I ended up using the \$ method which worked.
915
Posted By jaysunn
Command pipeline trouble
Hello,
I am attempting to ssh to a server and run a set of commands on a remote set of servers. I am getting the following error below, I am thinking quotes may be the problem. This command works...
2,486
Posted By jaysunn
That seems like a logical approach, I forgot to...
That seems like a logical approach, I forgot to mention that I need to do this on 75 servers without configuration management software, so the crontab command on each is not feasible.


My...
2,486
Posted By jaysunn
sed remove cron entry
Hello,
I am not having much luck with removing a entry in cron. I would like to get rid of the following line in /var/spool/cron/root.

1 09 * * 1-5 /etc/init.d/snmpd stop > /dev/null...
Forum: Red Hat 08-23-2012
2,485
Posted By jaysunn
I am not 100% sure what other filesystems would...
I am not 100% sure what other filesystems would be used for broadcast. What's the reason for not using the multicast method? The switch not allowing it?
Forum: Red Hat 08-22-2012
2,485
Posted By jaysunn
I believe that you can enable broadcast for...
I believe that you can enable broadcast for heartbeats by changing the following value from multicast to broadcast in /etc/cluster/cluster.conf on all clustered nodes. The CMAN service will need to...
1,363
Posted By jaysunn
Cool Command, Needs a " were the delimiter is...
Cool Command,
Needs a " were the delimiter is set.


linux:~$ awk -F"|' -v OFS="|" '{ for(N=1; N<=NF; N++) if($N == "@") $N="" } 1' filename
>
linux:~$ awk -F"|" -v OFS="|" '{ for(N=1; N<=NF;...
1,883
Posted By jaysunn
Alias's are pretty awesome as well. You can...
Alias's are pretty awesome as well.
You can add the following to your ~.bash_profile. You can substitute uname -a with any commands.

alias version='uname -a'alias crazypath='cd...
26,161
Posted By jaysunn
[solved]
@methyl,
Thanks for the advice. I let find look on the ext3 filesystem instead of not trying to search the nfs filesystem.

Thanks for the responses.

Jaysunn
26,161
Posted By jaysunn
Thanks Jim, [root@kickstart usr]# uname -a ...
Thanks Jim,
[root@kickstart usr]# uname -a
Linux kickstart.domain.local 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
26,161
Posted By jaysunn
find command exclude nfs mounts
Gentleman and Ladies,
I am having some difficulty in regards to the find utility. I am trying to not traverse nfs mounts when searching for files or directories.

This command does not seem to...
1,846
Posted By jaysunn
[solved]
@shamrock,
Very neat ex script. What seems to happen is I got dropped into VI when running this. I need to then :q to get out.

ex -s +'/@sysmon$/d | wq' /etc/syslog.conf

Thanks,
jaysunn
1,846
Posted By jaysunn
Thanks for helping!! @shamrock, Yes I just...
Thanks for helping!!
@shamrock,
Yes I just want to remove the line that contains "@sysmon".

I am sorry for wasting every ones time. After thinking about "More Criteria" that @Corona688...
1,846
Posted By jaysunn
Script to remove line of text
Hello,
I have a line that needs to be removed using sed -i to perform the replace in place. The issue that I have is the files on each server may contain extra rows after the last logger definition....
4,004
Posted By jaysunn
Thanks for the quick reply. This is what I need....
Thanks for the quick reply. This is what I need.
Please mark solved.
Showing results 1 to 25 of 103

 

Featured Tech Videos

All times are GMT -4. The time now is 05:36 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy