Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

shell script

Original Message
Name: lboogie
Date: March 19, 2007 at 10:12:44 Pacific
Subject: shell script
OS: windows xp
CPU/Ram: unknown
Comment:
I am trying to create a script that searches for a string. The script has to make a substitution and backup file only if the string is found in the file.

So far I ahve tried:
#!/bin/csh
set firstargument=$1
set second argument=$2
set filename=$3
grep $firstargument $filename
if (true)then
echo "performing substitution"
sed "s/secondargument/g" $filename.bak > $filename
mv $filename $filename.bak
else
echo "string not found"
endif

Please Help!



Report Offensive Message For Removal


Response Number 1
Name: Orochimaru
Date: April 19, 2007 at 09:12:30 Pacific
Subject: shell script
Reply: (edit)
Hey could you please help me!!!

Im trying to get an awk script to read a file (data.txt). this file conatains numbers only and print it to screen! into and array.
the file look lik this:

1
4
23
5
69
1
2

im trying to run an awk (ONLY) script that will read the numbers into an array and print it to screen! but i cant seem to find any help or books that show how to read numbers in awk instead of words!!!
is it me or am i just retarded!!!!

so the command line should be something like this:
# awk -f script.sh data.txt

this should invoke the script to read the data.txt file into an array and print it to screen
HELPPPPPPPPPPPPPPP!!!


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: shell script

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12

help mandriva install last straw!

Icon Scaling in Explorer Bar


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC