•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,423 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,615 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1122 | Replies: 2
![]() |
•
•
Join Date: Apr 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
i wrote this script, and everytime i run the script the code deletes and i want to know why
EDIT: i also chmod 755 if anyone wanted to know
just so everyone knows i just started to learn shell scripting
EDIT: i also chmod 755 if anyone wanted to know
$ cat > ispostive #!bin/sh # # Script to see whether argument is postive # if test $1 -gt 0 then echo "$1 number is postive" fi
just so everyone knows i just started to learn shell scripting
Last edited by milonix : Apr 21st, 2007 at 12:00 am.
•
•
Join Date: May 2006
Location: Bellevue, WA
Posts: 1,548
Reputation:
Rep Power: 8
Solved Threads: 51
That's an interesting use of cat. Anyways, I tried running it, and it worked fine after a small change (you didn't put a / before bin/sh, so working from anywhere other than the / directory would not work).
output:
output:
jimmy@vera ~/code/bash $ ./ispositive 4 4 number is postive jimmy@vera ~/code/bash $ ./ispositive -4 jimmy@vera ~/code/bash $ ./ispositive 1234567890 1234567890 number is postive jimmy@vera ~/code/bash $ ./ispositive 0
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- little shell scripting help here... (Shell Scripting)
- little shell scripting help here... (Legacy and Other Languages)
- new to shell scripting, need some help (Shell Scripting)
- how to Upload files using Linux bash Shell scripting and CGI (Shell Scripting)
- shell scripting help with backup script (Shell Scripting)
- "shell scripting tutorials?" (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: case statement (meaning of this block of code)
- Next Thread: anyone tried HLS firewall



Linear Mode