Search Results

Search: Posts Made By: vprasads
Forum: Programming 06-18-2010
4,057
Posted By vprasads
i tried this one to shift the element elephant to...
i tried this one to shift the element elephant to first position , but its not working, $_ is showing nothing here

if(grep $_ =~ m/elephant/, @array) {

unshift(@array, $_);
}

after moving...
Forum: Programming 06-17-2010
4,057
Posted By vprasads
how to put element of an array to first position.
hi,

I have a array like

my $array = ( "apple","ball","cat","dog","elephant");

how to push some element in the array to the first position.
for example my final array should be

elephant...
3,254
Posted By vprasads
extract last part of string.
Hi,

I have a string like this

BUNDLE=/home/bob/flx/user.bun

how to extract only the the last part ie, only user.bun
4,220
Posted By vprasads
Assume the file has tftp dgram ...
Assume the file has

tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd /tftpboott
tftp dgram udp wait anybody /usr/sbin/tcpd in.tftpd /tftpdboott
.
....
4,220
Posted By vprasads
Is it possible to change only the first line...
Is it possible to change only the first line which has tftpd leaving other lines which may have tftpd.can u pls share the code snippet and can i pass the pattern to be replaced by a variable?
4,220
Posted By vprasads
This will replace nobody to root in other lines...
This will replace nobody to root in other lines also,but i want to replace nobody to root in those lines containing /tftpboott
4,220
Posted By vprasads
Need to change two words in a line using shell script.
Hi,
i have a line

tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd /tftpboott

in /etc/inet.conf file. ineed to replace nobody with root and /tftpboott with /flx/boot. i...
Showing results 1 to 7 of 7

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