Sponsored Content
Full Discussion: Remove % from a variable
Top Forums Shell Programming and Scripting Remove % from a variable Post 302553595 by itkamaraj on Thursday 8th of September 2011 03:28:35 AM
Old 09-08-2011
can you post the output of df -k $fs ( any one mount point )
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Variable has spaces around the string, need to remove them

Hi all, I'm a newbie to the Linux world and I got a couple of shell script questions: (1) How do combine two variables and make it equal to a third variable? For example, I got a variable $A=FirstName, $B=LastName, and I want to combine the variable into one variable so when you echo the final... (4 Replies)
Discussion started by: mikey20
4 Replies

2. Shell Programming and Scripting

Remove non numeric values from a variable

Hello all, I am working on a basic script but need a little help. Issue: I am running a SQL Query using sqlplus and a shell script. I have the output of the statement stored as variable $A. $A is set to "other text here 45678754 other text here". I need to strip all text except that numeric... (13 Replies)
Discussion started by: ownedthawte
13 Replies

3. UNIX for Dummies Questions & Answers

Remove characters from string variable

I am running a script where one of the variables (the month and year) is input at the command line. What I would like to do is chop off the last few characters of that string to create a new variable, while maintaining the old one. The script is run like this: ./pull_station_v4.csh KYWST... (3 Replies)
Discussion started by: TheSMan5
3 Replies

4. Shell Programming and Scripting

How to remove the first character on a string in a variable

Hi all, Does anyone know how to code in ksh that will remove the first character in a string variable and replace that variable without the first character? Example: var1=ktest1 will become var1=test1 var2=rtest2 will become var2=test2 Need help please. (10 Replies)
Discussion started by: ryukishin_17
10 Replies

5. Shell Programming and Scripting

How to remove trailing spaces from a variable?

I am getting a value from a csv file using CUT command, however the command extracting the records with trailing spaces. I am using the result into a sql session to fetch data, because of the trailing spaces the sql session is unable to fetch any data. Please let me know, how to remove this... (2 Replies)
Discussion started by: mady135
2 Replies

6. Shell Programming and Scripting

PERL : Remove spaces in a variable

I have a variable I want to remove the spaces in between. The output should be How can this be done Any help will be appreciated. Thanks in advance (1 Reply)
Discussion started by: irudayaraj
1 Replies

7. Shell Programming and Scripting

How to remove new line from variable?

I have following codes: ~$ var_1="ABC" ~$ echo $var_1 | wc -m 4 ~$ echo -n $var_1 | wc -m 3 ~$ var_2=`echo -n $var_1` ~$ echo $var_2 ABC ~$ echo $var_2 | wc -m 4 ~$ I would suppose the last command ~$ echo $var_2 | wc -m would give 3; but apparently, var_2 still has the new line... (5 Replies)
Discussion started by: littlewenwen
5 Replies

8. Shell Programming and Scripting

Remove appending 0 from file variable

Dear All, i have filename RYK3201_032001002.pdf and i am using below command to get a file file_name1=$(echo $file_name | cut -d "_" -f2 | cut -d "." -f1 | cut -c -6) and then file_name2=${NewFile_NAME}_$file_name1 now the value of file_name1 will be 032001 i want to file_name1... (5 Replies)
Discussion started by: yadavricky
5 Replies

9. UNIX for Dummies Questions & Answers

Remove newline char from variable

I have a file ABC.DAT with 2 columns avaialble Data format : XYZ!$#$!120 XXZ!$#$!1000 YYZ!$#$!104 While running the following code : FILE_COUNTER=1; RECORD_CN_FILE_COUNT=$((`wc -l ABC.DAT| cut -f1 -d' '`)); while do FILE_NAME=`cat ABC.DAT.DAT| head -$FILE_COUNTER |tail -1 | awk -F... (1 Reply)
Discussion started by: Nikhil Gautam
1 Replies

10. Shell Programming and Scripting

Remove the \r \n from the variable

I a have a delimited file that has a 2 column which I need to read and pull out both columns from the file.Now the while pulling out the second column and storing in a variable I get a \r\n charachter embedded in the output when an od -c is run.How can I remove the \r\n columns from the file. ... (3 Replies)
Discussion started by: Nikhil Gautam
3 Replies
File::Remove(3) 					User Contributed Perl Documentation					   File::Remove(3)

NAME
File::Remove - Remove files and directories SYNOPSIS
use File::Remove 'remove'; # removes (without recursion) several files remove( '*.c', '*.pl' ); # removes (with recursion) several directories remove( 1, qw{directory1 directory2} ); # removes (with recursion) several files and directories remove( 1, qw{file1 file2 directory1 *~} ); # trashes (with support for undeleting later) several files trash( '*~' ); DESCRIPTION
File::Remove::remove removes files and directories. It acts like /bin/rm, for the most part. Although "unlink" can be given a list of files, it will not remove directories; this module remedies that. It also accepts wildcards, * and ?, as arguments for filenames. File::Remove::trash accepts the same arguments as remove, with the addition of an optional, infrequently used "other platforms" hashref. SUBROUTINES
remove Removes files and directories. Directories are removed recursively like in rm -rf if the first argument is a reference to a scalar that evaluates to true. If the first arguemnt is a reference to a scalar then it is used as the value of the recursive flag. By default it's false so only pass 1 to it. In list context it returns a list of files/directories removed, in scalar context it returns the number of files/directories removed. The list/number should match what was passed in if everything went well. rm Just calls remove. It's there for people who get tired of typing remove. clear The "clear" function is a version of "remove" designed for use in test scripts. It takes a list of paths that it will both initially delete during the current test run, and then further flag for deletion at END-time as a convenience for the next test run. trash Removes files and directories, with support for undeleting later. Accepts an optional "other platforms" hashref, passing the remaining arguments to remove. Win32 Requires Win32::FileOp. Installation not actually enforced on Win32 yet, since Win32::FileOp has badly failing dependencies at time of writing. OS X Requires Mac::Glue. Other platforms The first argument to trash() must be a hashref with two keys, 'rmdir' and 'unlink', each referencing a coderef. The coderefs will be called with the filenames that are to be deleted. SUPPORT
Bugs should always be submitted via the CPAN bug tracker <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove> For other issues, contact the maintainer. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Some parts copyright 2006 - 2012 Adam Kennedy. Taken over by Adam Kennedy <adamk@cpan.org> to fix the "deep readonly files" bug, and do some package cleaning. Some parts copyright 2004 - 2005 Richard Soderberg. Taken over by Richard Soderberg <perl@crystalflame.net> to port it to File::Spec and add tests. Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>. This program is free software; you can redistribute and/or modify it under the same terms as Perl itself. perl v5.16.3 2012-03-19 File::Remove(3)
All times are GMT -4. The time now is 09:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy