09-05-2015
Thank you! One more question, what is the concept name behind # and %? I want to search and learn more information about this, but not sure what to exactly look for. Are they string operators? Thanks again!
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
2. Shell Programming and Scripting
hi All,
cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'
Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies
3. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
4. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
5. Shell Programming and Scripting
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies
6. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
7. Shell Programming and Scripting
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
9. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT CENTOS
io::string
String(3) User Contributed Perl Documentation String(3)
NAME
IO::String - Emulate file interface for in-core strings
SYNOPSIS
use IO::String;
$io = IO::String->new;
$io = IO::String->new($var);
tie *IO, 'IO::String';
# read data
<$io>;
$io->getline;
read($io, $buf, 100);
# write data
print $io "string
";
$io->print(@data);
syswrite($io, $buf, 100);
select $io;
printf "Some text %s
", $str;
# seek
$pos = $io->getpos;
$io->setpos(0); # rewind
$io->seek(-30, -1);
seek($io, 0, 0);
DESCRIPTION
The "IO::String" module provides the "IO::File" interface for in-core strings. An "IO::String" object can be attached to a string, and
makes it possible to use the normal file operations for reading or writing data, as well as for seeking to various locations of the string.
This is useful when you want to use a library module that only provides an interface to file handles on data that you have in a string
variable.
Note that perl-5.8 and better has built-in support for "in memory" files, which are set up by passing a reference instead of a filename to
the open() call. The reason for using this module is that it makes the code backwards compatible with older versions of Perl.
The "IO::String" module provides an interface compatible with "IO::File" as distributed with IO-1.20, but the following methods are not
available: new_from_fd, fdopen, format_write, format_page_number, format_lines_per_page, format_lines_left, format_name, format_top_name.
The following methods are specific to the "IO::String" class:
$io = IO::String->new
$io = IO::String->new( $string )
The constructor returns a newly-created "IO::String" object. It takes an optional argument, which is the string to read from or write
into. If no $string argument is given, then an internal buffer (initially empty) is allocated.
The "IO::String" object returned is tied to itself. This means that you can use most Perl I/O built-ins on it too: readline, <>, getc,
print, printf, syswrite, sysread, close.
$io->open
$io->open( $string )
Attaches an existing IO::String object to some other $string, or allocates a new internal buffer (if no argument is given). The
position is reset to 0.
$io->string_ref
Returns a reference to the string that is attached to the "IO::String" object. Most useful when you let the "IO::String" create an
internal buffer to write into.
$io->pad
$io->pad( $char )
Specifies the padding to use if the string is extended by either the seek() or truncate() methods. It is a single character and
defaults to "