The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX newbie NEWBIE question! Hanamachi UNIX for Dummies Questions & Answers 4 03-28-2009 04:10 PM
newbie need help on cat chitti76 UNIX for Dummies Questions & Answers 1 09-14-2007 11:02 PM
awk newbie zoo591 Shell Programming and Scripting 4 08-03-2006 03:14 PM
Please Help newbie >.< GCTEII Shell Programming and Scripting 1 02-26-2006 04:19 PM
NEWBIE << help >> LolapaloL High Level Programming 1 11-13-2001 01:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-27-2008
cristi2008 cristi2008 is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 14
My first program!

Hi to everyone!
I say from the begining the I'm new to shell scripting but I want to learn it.
My first request sound like this:
I would like to make a shell script the returns a number but in the oposite way
(Ex:
input:123
output:321
)
Can it be done?
And if you would like to explain the commands that are used.
Thanks.

Last edited by cristi2008; 11-27-2008 at 06:49 AM..
  #2 (permalink)  
Old 11-27-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,259
Use the search function please, ty.

Reversing and trim a String through SHELL script
  #3 (permalink)  
Old 11-27-2008
cristi2008 cristi2008 is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 14
ok!
I didn't understood verry much but:
I need a script that starts whit
" #!/bin/bash
read number
......


echo $reversenumber "
something like this.
And please explain the commands.Thank you.
  #4 (permalink)  
Old 11-27-2008
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,953
why do you need this script?
  #5 (permalink)  
Old 11-27-2008
cristi2008 cristi2008 is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 14
Because I've heard that this is the easyiest method and it could be a good start for me.Thanks!
  #6 (permalink)  
Old 11-27-2008
Christoph Spohr Christoph Spohr is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 205
Hi,

you are nearly there. It is as easy as:

Code:
#! /bin/sh
echo "Enter number: "
read number
echo "Number reversed: "
echo $number | rev
HTH Chris
Closed Thread

Bookmarks

Tags
awk, awk trim, shell script, shell scripting, trim, trim awk, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0