Search Results

Search: Posts Made By: 4scriptmoni
Forum: Programming 11-20-2008
6,557
Posted By 4scriptmoni
uh.. i should have thought of spliting it! ...
uh.. i should have thought of spliting it!
thank you
Forum: Programming 11-20-2008
6,557
Posted By 4scriptmoni
Perl get a part of a string
I need some help to divide an email address.
I need to grab the left part of the @. Maybe substr?
example:
john.smith@domain.com.br

I would need to grab just the username part...



my...
37,867
Posted By 4scriptmoni
yes! thanks so much
yes! thanks so much
37,867
Posted By 4scriptmoni
works
thanks it worked.
Now i have little problem with output.
I performa backup but tar always give me a output:
"tar: Removing leading `/' from member names"
I tried using &>/dev/null || exit 0 but...
2,348
Posted By 4scriptmoni
crontab
The syntax is:
* * * * * Command to be executed
- - - - -
| | | | |
| | | | +-- Day of week (0-6)
| | | +--- Month (1 - 12)
| | +--- Day of month (1 - 31)
| +---- Hour (0 - 23)
+----- Min (0...
37,867
Posted By 4scriptmoni
Perl System command calls to variable
I am new to scripting in Perl so I have a dumb question.
I know I can call system commands using

system("date");

But I am not able to:
1. set its output to a variable
2. run in quiet mode(no...
3,406
Posted By 4scriptmoni
found MAC
well I just found out that the MAC address is also here
cat /sys/class/net/<INF>/device/net/<INF>/address
<INF> = interface ( eth0, wlan0) etc...
3,406
Posted By 4scriptmoni
Parsing X char from right to left
I am new to bash scripts I need something quite easy to do in VBS,
When I wanted to get the first 5 chars I used funcition right(5,strGet)
how can I do the same in bash?
I am trying to get the MAC...
18,865
Posted By 4scriptmoni
thanks, but still not working... sed '/alias...
thanks, but still not working...
sed '/alias 24x7-comunicacions/a\'"$LINEX" $FILECFG >>temp.txt

It keeps doing only the first value of $LINEX variable. Maybe I should append all lines to LINEX ...
18,865
Posted By 4scriptmoni
so?
sorry I got lost.
so what syntax should i use?

sed 'alias 24x7-comunicacionsa\'"$LINEX" "$FILECFG" >>temp.txt
18,865
Posted By 4scriptmoni
thanks
thanks bakunin,
the explanation was perfect.
but i am afraid it didnt work.
I have this inside a loop and I cant make it work :(
Because I belive the sed is appending write under the
string:...
12,031
Posted By 4scriptmoni
nope
thanks but that was not what i needed.
I need to remove an entire line where I find certain STRING.
But I shuold not have to specify the filename, just the folder. I have to do this
in multiple...
18,865
Posted By 4scriptmoni
thanks
I tested both solutions, and they both works. Thank you!
I like the sed one more, its just less complicated command.
But both output to the screen I need it to write to that same file.
I tried ...
18,865
Posted By 4scriptmoni
Insert a line in a text file
So I need to write lines into line X of file X.
I can get the file by doing:

cfgnumber=$(cat -n -comm.cfg| grep -i "servicegroup_name 24x7-comunicacions")
echo $cfgnumber
it outputs the Line...
12,031
Posted By 4scriptmoni
Delete a Line with a string X
Hi guys, I am new here. I have done many scripts in VisualBasic and batch.
Now going to *inux and learning bash and perl, quite amazing commands I find in linux, like sed, grep, awk and so on...
...
Showing results 1 to 15 of 15

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