I'm trying to find a command that will trim the white space off a string.
e.g.
$str = " stuf "
$str = trim ( $str )
echo $str // ouput would just be stuf
Thanks, Mark (4 Replies)
All,
I'm a newbie at shell scripting and regular expressions and I just need to take a file that's arranged like the one below, remove all leading and trailing whitespace and add a line break after each word. I've been able to remove a few spaces using various awk, sed and Perl scripts, but... (7 Replies)
Hi Friends,
Can any one help with this issue:
How to trim spaces for each line at the end,
Like I have a file in this format.
EMP1 SMITH 46373 5 STREET HOWARD 74636
EMP2 JONES 5454 { these are spaces ........}
EMP3 SMITH 46373 5 STREET HOWARD 74636
EMP4 JON 2554 { these are... (1 Reply)
Hello,
I am passing a filename to a script to draw parameters from it. However, I want to use part of the filename as a parameter. The filename is transfer_ccf_3731_10.sh but I only need the 3731_10 part of it.
Is this possible? Any help or suggestions would be appreciated!
Regards,
J. (4 Replies)
Hi All,
I am using trim in my code..
ID_SA_SOURCE="`echo "$data" | cut -c17-34 | tr -s " "`"
ID_SA_DEST="`echo "$data" | cut -c35-52 | tr -s " "`"
echo"$ID_SA_SOURCE";"$ID_SA_DEST";
the output is
0608166896; 3001339; contains one whitespace between the two ..how can i remove that single... (3 Replies)
Hi all,
I've been looking for how to eliminate blank spaces in a variable or strings. I've seen several ways, using sed, awk and even python. One of them is use 'tr' command, but it does not work as I expected: For example:
echo " stuff " | tr -s " "leaves one space ahead and another... (3 Replies)
To trim 3rd field in for all the lines of a file and replace the modified string in that particular field.
For example i have a file called Temp.txt having content
Temp.txt
-----------------
100,234,M1234
400,234,K1734
300,345,T3456
----------------
So the modified file output should... (4 Replies)
FOLKS ,
i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one.
thanks...
Venu (3 Replies)
Hi All,
I have a file named as
FAB1_600015_CONRAD.A0_7XYZ12345.000_LT-SWET.01_LTPA25L_20110622-161429_07_WFR12345_20110622-161429_20110712-125228.data.dis
I want to generate a directory taking only the 7XYZ12345.000_WFR12345
The length and format of the Filename will be the same... (2 Replies)
Discussion started by: asheshrocky
2 Replies
LEARN ABOUT HPUX
auto_parms
auto_parms(1M)auto_parms(1M)NAME
auto_parms - initial system configuration plus DHCP support command
SYNOPSIS DESCRIPTION
The command is a system initialization command that handles first-boot configuration, that is, the setting of unique system "initial iden-
tity parameters", and ongoing management of DHCP lease(s). The command is invoked at boot time by the command. Initially it loads a list
of available ethernet interfaces and requests a DHCP lease on each interface. See the rc(1M) manpage for information about for invocation
context.
While checking for availability of a lease on each interface, also consults and examines the variable If it is set to "1", attempts to
request a lease on the the interface designated by If is set to "0" (the default case) or is absent from does not attempt a DHCP request on
that interface.
Once a lease is secured, the information supplied with the lease is used to initialize key networking parameters; see dhcpdb2conf(1M).
If detects that the system is undergoing "first-boot" (meaning the system's hostname is not yet set), it invokes to verify the DHCP-sup-
plied parameters and to collect any parameters not supplied by DHCP.
For all subsequent boots, the data supplied by a DHCP lease is assumed by to be correct. Note that in a (non-mobile) environment where
DHCP is used for IP address management, under normal conditions the lease information should not change between reboots. This is accom-
plished by placing in "lease maintenance mode" prior to exiting.
FILES
The command itself.
Common subroutines used by
and sub-area commands.
Log files written and saved by
AUTHOR
The command was developed by HP.
SEE ALSO dhcpdb2conf(1M), rc(1M), set_parms(1M).
auto_parms(1M)