10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have script data.sh which has following error.
Script Name : data.sh
#!/bin/sh
infile=$1
len=${#infile}
echo $len
texfile=${infile:0:$len-4}
echo $texfile
run command
./data.sh acb.xml
I get following error message: (5 Replies)
Discussion started by: man4ish
5 Replies
2. Shell Programming and Scripting
Hi all,
Actually I have a huge bash file like:
port1=$PORT && if ; then .....
....stuff
port2=$PORT && if ; then .....
...stuff
port3=$PORT && if ; then .....
...stuff
port4=$PORT && if ; then .....
...stuff
port5=$PORT && if ; then .....
I would like to change the $port inside... (2 Replies)
Discussion started by: Dedalus
2 Replies
3. Shell Programming and Scripting
Hi All,
I'm trying to run a similar script to copy a files from one location to another.
#!/bin/bash
source="/home/pradeepk/a.txt"
destination="/home/pradeepk/dir1"
cp $source $destinationi'm getting following error.
cp: cannot stat `/home/pradeepk/a.txt\r': No such file or directorywhen... (1 Reply)
Discussion started by: pradeep2002gs
1 Replies
4. UNIX for Dummies Questions & Answers
Hello!!
Am trying to substitute the value of a shell variable with the value of another shell variable. The values are obtained into the shell variables through some other processing.
for ex.
i've used the follow sed command..
sed "s/$var1/$var2/g"
i've also tried the other... (5 Replies)
Discussion started by: a_ba
5 Replies
5. Solaris
Hi guys. Good day, morning, afternoon or night, depending on where you live.
I have a script shell in which I am looping on files (absolute path) see code section above.
I always have an error: bad substitution.
:wall:
Is it because my variable file is the index of the loop and not a normal... (4 Replies)
Discussion started by: soueric
4 Replies
6. Shell Programming and Scripting
mv myFile.txt myFile.txt.bak
sed s/foo/bar/g myFile.txt.bak > myFile.txt
Turn the two-line version, above, of the substitution commands into a shell script, subst1 taking three parameters:
the string to be replaced
the string with which to replace it
the name of the file in which to make the... (1 Reply)
Discussion started by: RogerW
1 Replies
7. Shell Programming and Scripting
Hi guys, I'm looking for some thoughts on this. I'm trying to do a clean 1 liner to substitute some values. What I have:
sed 's/Personid=.*/Personid=xxxxxx/' $tmpFileOut
sed 's/Person:.*/Person:xxxxxx/' $tmpFileOut
sed 's/PersonID:.*/PersonID: xxxxxx/' $tmpFileOut
Obviously that's a bit... (1 Reply)
Discussion started by: rich@ardz
1 Replies
8. Shell Programming and Scripting
Hello, I was hoping for a second pair of eyes or a little bit of help figuring out what my error is in a script. I did some searching in the forums and didn't find anything so please forgive me if it a similar problem has been discussed before.
My script accepts normal user arguments; however,... (2 Replies)
Discussion started by: Jackinthemox
2 Replies
9. Solaris
Hi,
I have to read a file and translate the contents including substituting the variables if any and write to another file without using sed or awk.
For ex:-
inputfile.txt
-----------
servername=$SERVER
application=$APPL
outputfile.txt
------------
servername=actual server name... (2 Replies)
Discussion started by: axes
2 Replies
10. UNIX for Advanced & Expert Users
My specific goal: automatically edit a Makefile variable's (EXTRAVERSION)
value in a kernel Makefile.
So, I have a shell script that takes one parameter, a version string:
buildkernel.sh 2.6.18.21.7-custom
In the script, I assign the parameter to K_VER:
K_VER="2.6.18.21.7-custom"... (2 Replies)
Discussion started by: duderonomy
2 Replies