Sponsored Content
Top Forums Shell Programming and Scripting Getting foreach to read a parameter with blank space Post 302629491 by Marhsall34 on Tuesday 24th of April 2012 08:33:15 PM
Old 04-24-2012
agama, that code foreach file (${*:q}) would fix the issue with the spaces but what if the file extension had the special character "$" in it. For example, what if the file name was foo$e.b$l and I wanted to rewrite it to foo$e.ball using the same script...

Example: ./chExt.sh 'ball' 'foo$e.b$l'

This command would not create the file "foo$e.ball"

Any help with this? Must be one little tweek of the code somewhere.

Last edited by Marhsall34; 04-24-2012 at 10:01 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

append blank space

Hi, I would like to add blank space for fixed length(50) if length of string <30. Scenario: File Size AAA.CSV 123 BB.CSV 134 Expected: File Size AAA.CSV 123 BB.CSV 134 I want append blank space until 30 character. Thanks and Regards, HAA (1 Reply)
Discussion started by: HAA
1 Replies

2. AIX

How can i replace a character with blank space?

i want a command for my script!!! say file consists of character 123 125 127. i need a query to replace the number 2 with 0 so the output should be 103 105 107. i use unix-aix (8 Replies)
Discussion started by: rollthecoin
8 Replies

3. Shell Programming and Scripting

Blank space cause error when use perl

I write a script with register and login user. So, i encrypt password with encryptedpass=`perl -e "print crypt("${mypass}",salt)"` if password do not contain blank space, it work but if password have blank space, it cause error in that line the error is: syntax error at -e ..... Anyone... (3 Replies)
Discussion started by: WuZun
3 Replies

4. Shell Programming and Scripting

Cut last blank space

Hello, I am using this to get only directories : ls -l | grep '^d'and here is the result : drwx------ 13 so_nic sonic 13 Nov 4 13:03 GLARY drwx------ 3 so_nic sonic 3 May 6 2010 PSY2R drwx------ 15 so_nic sonic 15 Oct 14 08:47 PSYR1 But I only need to keep this... (7 Replies)
Discussion started by: Aswex
7 Replies

5. UNIX for Dummies Questions & Answers

blank space

hi everyone, i have a problem in unix script , i need to remove line that has blank , not blank line . example: mahm,,jdggkhsd,ghskj,,fshjkl can anyone help? (4 Replies)
Discussion started by: Reham.Donia
4 Replies

6. UNIX for Dummies Questions & Answers

Replace colon with blank space

Dear Gurus, I have a unix file with multiple colons on each row, and I would like to replace each colon with a blank space using the awk command. For example, I have the following data: Data: --------- A~000000000000518000~SLP:~99991231~20090701~00102.00~USD:~CS:~... (2 Replies)
Discussion started by: chumsky
2 Replies

7. Shell Programming and Scripting

grep to remove blank space

Hi All, Need help to grep blank and copy to file. I have a file in below format dns1dm06_10, dns2dm02_04, dbidub,10000000c9a46d0c gbpuhci,10000000c948b00a ibtur001,10000000c9a1ccda yubkbtp1,10000000c93fec5b I need to copy to all lines which doesn't have wwn >> no-wwn.txt 1... (2 Replies)
Discussion started by: ranjancom2000
2 Replies

8. Shell Programming and Scripting

Not delete space blank

Hi everyone, i need to "grep" a file with a string with space blanks, like this: grep "XXXX XX" file.txt The problem, i need put the "XXXX XX" in a string variable. When the script executes the grep, do: gresp XXXX XX file.txt How can i solve this problem? The... (5 Replies)
Discussion started by: Xedrox
5 Replies

9. Shell Programming and Scripting

Removing blank space using VI

Hi, How to remove blank spaces using vi (I am using AIX)? #cat siva.txt AAA BBB CCC DDD EEE FFF Need to remove space between 2 columns. Regards, Siva (7 Replies)
Discussion started by: ksgnathan
7 Replies

10. Shell Programming and Scripting

Help to identify blank space in a file

Hello, I have a dictionary of over 400,000 words with the following structure source=target The database contains single words as well as phrases. To train the data, I need only mappings with out a space i.e. where both source and target do not have any space in between. I use Ultraedit as... (4 Replies)
Discussion started by: gimley
4 Replies
pods::SDLx::Controller::Interface(3pm)			User Contributed Perl Documentation		    pods::SDLx::Controller::Interface(3pm)

NAME
SDLx::Controller::Interface - Interface Physics and Rendering with the Controller with callbacks CATEGORY
Extension, Controller SYNOPSIS
use SDL; use SDLx::App; use SDLx::Controller::Interface; #SDLx::App is a controller my $app = SDLx::App->new(width => 200, height => 200 ); my $ball = SDLx::Controller::Interface->new( x=> 10, y => 50, v_x => 10, v_y=> 20 ); #Set the initial state of the ball's physics, this is optional $ball->set_acceleration( sub { my ($time, $current_state) = @_; return( 0, -10, 0 ); # Return accelerations (x,y,rotation) } ); my $ball_render = sub { my $state = shift; $app->draw_rect( undef, 0 ); $app->draw_rect( [$state->x, $state->y, 10,10], [255,0,0,255] ); $app->update(); }; $ball->attach( $app, $ball_render, @params ); $app->run(); $ball->detach(); #can be called at anytime (for example when ball 'dies') DESCRIPTION
METHODS
set_acceleration Allows you to set the acceleration callback for defining the interface's behaviour in terms of x,y and rotation. $interface->set_acceleration ( sub { my ($time, $current_state) = @_; return ( $accel_x, $accel_y, $torque ); } ); These accelerations are arbitrary and can be set to any frame of reference. Your render callback will handle how to interpret it. The callback will receive the time and the current state as a "SDLx::Controller::State" element. attach Attaches the interface to a controller with a render callback $interface->attach( $controller, $render, @params ); Where $render is a callback that receives the interpolated "SDLx::Controller::State". my $render = sub { my ($state, @params) = @_; # draw the current $state. }; The @params are any extra parameters you would like to pass to the $render callback. current my $current_state = $interface->current(); Returns the current state of the interface as a "SDLx::Controller::State". previous my $previous_state = $interface->previous(); Returns the previous state of the interface as a "SDLx::Controller::State". detach $interface->detach(); If $interface has been "attach()"'ed to any controller it will be detached now. OTHER METHODS
Don't use these unless you really really want to. acceleration Call the acceleration callback once. interpolate Interpolate the current state evaluate Evaluate the new current and previous state. update Update the states by integrating with time. AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDLx::Controller::Interface(3pm)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy