This is why you should always post your script, not just the tiny bit of it you think's the problem. Sometimes it's taken pages of yelling to discover they changed IFS somewhere
Whenever I must change IFS, this is what I do:
If I must change it for a whole block I do this:
Last edited by Corona688; 01-17-2013 at 04:23 PM..
please refer the following 2 statements...
1)
int i=1,j;
j= i++ + i++;
2) int i=1,j;
j=++i + ++i;
how j becomes 2 and 6 for the above 2 statements
respectively ???
( i guessed j must be 3 and 5)
Somebody define the exact reason please.. :(
... (2 Replies)
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Hi,
I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is.
I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Hello All,
I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.
My file is like this (<b> means one blank space, <t> means one tab space)-
$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Hello,
I have a script which configures a system,
the configuration is currently manual and error prone.
I am writting a script, which currently uses hard-coded values.
I don't know how to take an IP, e.g. 123.456.789.111, and backslash the periods, so I can pass it to an
`exec perl... (0 Replies)
How to get the file extension having multiple periods
suppose i have a file samplewprk.txt.dat
I need to retrieve txt.dat from the file.
I worked all iam getting is either txt or pyd
Could anyone help me in providing the solution?
Thanks,
in advance (3 Replies)
Hi,
I have a number of large files (up to 4GB) that I wish to split in 96 parts e.g. one for each 15 minutes of the day. The split can be random so I am using
split -b 42M filename.csv
I want to name each of the resultant files as a distinct 15 minute period of the day e.g. ... (10 Replies)
Discussion started by: ksexton
10 Replies
LEARN ABOUT CENTOS
hostname
HOSTNAME(5) hostname HOSTNAME(5)NAME
hostname - Local hostname configuration file
SYNOPSIS
/etc/hostname
DESCRIPTION
The /etc/hostname file configures the name of the local system that is set during boot using the sethostname(2) system call. It should
contain a single newline-terminated hostname string. The hostname may be a free-form string up to 64 characters in length; however, it is
recommended that it consists only of 7-bit ASCII lower-case characters and no spaces or dots, and limits itself to the format allowed for
DNS domain name labels, even though this is not a strict requirement.
Depending on the operating system, other configuration files might be checked for configuration of the hostname as well, however only as
fallback.
You may use hostnamectl(1) to change the value of this file from the command line.
HISTORY
The simple configuration file format of /etc/hostname originates from Debian GNU/Linux.
SEE ALSO systemd(1), sethostname(2), hostname(1), hostname(7), machine-id(5), machine-info(5), hostnamectl(1), systemd-hostnamed.service(8)systemd 208HOSTNAME(5)