04-27-2010
Simple unix variables in script
I'm creating a script that asks a user for a variable
ex
read filename;
read numberinput;
I also have a bunch of files named file.0 file.1 ... file.55
I'm trying to delete all files (if they exist) about file.$numberinput.
Can someone help me out on how to include the variable as part as the filename?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I don't know anything about UNIX. I have been developing on NT platform and now a batch file I was running in my java code must work on UNIX instead. How do I change the below .bat file into a shell script that can be run on UNIX? Thanks in advance for your help.
@ECHO OFF
D:... (1 Reply)
Discussion started by: ci2a020
1 Replies
2. Shell Programming and Scripting
when i run this script:
# Author: xtos
if
then
echo "Please enter ONLY one name to search, (example "$0" NAME)"
exit
fi
INPUT="grep $1 $HOME/work/phone_book"
if
then
echo "Listing not found, please try again."
else (2 Replies)
Discussion started by: xtos
2 Replies
3. Shell Programming and Scripting
I want to write a script to go to particular path in file and run shell script from there.
what will be shell script for the same. (2 Replies)
Discussion started by: shekhar_ssm
2 Replies
4. Shell Programming and Scripting
Hi Guys
Looking for a little help with a script to grep all files looking for hard coded variables - ie its IP address... so we know which files to look at before an IP change...
This is what I have - but it seems to loop and never end...
Any better suggestions?
#!/usr/bin/ksh
#simple... (2 Replies)
Discussion started by: serm
2 Replies
5. Shell Programming and Scripting
Hi
I am trying to add variables(float values) in a unix script but am getting an error
value=`expr $a + $b + $c`
The error I am getting is "expr: non-numeric argument"
I guess it has got to something with the decimal points.
Plz help (13 Replies)
Discussion started by: akashtcs
13 Replies
6. Shell Programming and Scripting
Am trying to lean perl scripting in Unix OS to automate my tasks.
Please find the below perl script i have tried
#!/usr/bin/perl -w
print "Please Enter the VG name to be checked:";
$A = <>;
print "Please Enter the free size to be checked in GB:";
$B = <>;
$vgcheck = `vgdisplay... (7 Replies)
Discussion started by: jayachandran87
7 Replies
7. UNIX for Dummies Questions & Answers
oopps! I Meant "Define Variables within a UNIX Script"
What would be the best way to define a variable in a unix shell script so anyone who views this script doesn't know what value is assigned to that variable.
some other location...
a="/usr/lib/fileA"
Unix script...
sed... (5 Replies)
Discussion started by: macastor
5 Replies
8. Shell Programming and Scripting
hi guys,
i need a script that does a simple task on multiple aix servers.
if possible with both telnet and ssh.
the simple task i wanna do is connect to a server and run "ifconfig -a" and get the output. nextweek i need to do similar jobs on like 50 servers... :(
can anybody help me with making... (2 Replies)
Discussion started by: curtis911
2 Replies
9. Shell Programming and Scripting
Hey all,
I would like to ask your help and sorry in advance for my ignorance since I am a complete beginner in this.
I need to create a UNIX script that will:
- scan a small number of folders and subfolders (see a similar file tree in the attachment)
-
- for each final folder (each of... (8 Replies)
Discussion started by: McNulty
8 Replies
10. Shell Programming and Scripting
Hello All,
My name is vasu and I am very new to Unix scripting, i know basic commands, but now i need to write the following script, i have tried but no luck
My requirment is i am getting one our from another command as following
Used:1.8TB Advisory Quota:1.8TB aaa1
Used:4.5TB Advisory... (1 Reply)
Discussion started by: VasuKukkapalli
1 Replies