10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script.
filecreatenew () {
touch /usr/src/$1_newfile.txt
var=$1
echo $var
touch /usr/src/$var_newfile_with_var.txt
}
filecreatenew myfile
Its creating file /usr/src/myfile_newfile.txt as the variable $1 is correctly used. When $ is... (2 Replies)
Discussion started by: anil510
2 Replies
2. Shell Programming and Scripting
Hi
I am setting the variables like this :
setenv MODULE1 modem5__3
setenv MODULE2 modem5__2
setenv MODULE3 modem_ctrl_1_1
setenv MODULE4 modem_1_0
setenv COUNT 10
I am having a bash script as shown below
################################################
#!/bin/bash
for ((... (5 Replies)
Discussion started by: kshitij
5 Replies
3. 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
4. Shell Programming and Scripting
Hi I am trying to do the following in a script find a string and add in a block of text two lines above on the command line this works fine
#/usr/bin/cat /usr/local/etc/dhcpd.conf_subnet | /usr/xpg4/bin/sed -n -e '1h;1\!H;${;g;s/}.*#END of 10.42.33.0/#START of RANGE $dstart\:option... (3 Replies)
Discussion started by: eeisken
3 Replies
5. Shell Programming and Scripting
Allright so a quick question.
I'm building a script that will eventually do a full IP subnet scan.
It starts off by first entering an IP address, (capturing host and net ID comes after that) and I want it to use the current IP address if no input is given.
Is there a quick way to define the... (1 Reply)
Discussion started by: BisMarc
1 Replies
6. Shell Programming and Scripting
Hello,
I Have a file like this, with five columns:
B D F T L
---------
0 0 0 0 0
0 0 0 1 0
0 2 0 0 1
I need, for each row, to append another five columns similar to the first ones, but with the field labeled as "T" (4th field of the column) substituted in this way:
(16 * value of... (3 Replies)
Discussion started by: PapaJustify
3 Replies
7. UNIX for Dummies Questions & Answers
Hey, guys!
Trying to research this is such a pain since the read command itself is a common word. Try searching "unix OR linux read command examples" or using the command substitution keyword. :eek:
So, I wanted to use a command statement similar to the following.
This is kinda taken... (2 Replies)
Discussion started by: ProGrammar
2 Replies
8. Shell Programming and Scripting
Hi All,
I'm looking for some expert help on sed/script to work out the best way to transform one xml format into another however there are a few complexities around translation.
The extra complexities are to:
1) take the start and stop time (YYYYMMDDHHMMSS) and convert to start time to unix... (8 Replies)
Discussion started by: hotbaws11
8 Replies
9. Shell Programming and Scripting
When script is running you only see when some of the commands are not successfull.
Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Discussion started by: gr0124
3 Replies
10. 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