10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a for loop that constructs a variable "filelistonly" having entries separated by "\n" new line.
The second, third & fourth while loops are my attempt to iterate the variable "filelistonly" upon new line "\n", however non of them work.
Below is my script:
//First Loop
for i in... (2 Replies)
Discussion started by: mohtashims
2 Replies
2. Shell Programming and Scripting
I am unable to expand the value of entry variable inside the nawk command.
I tried three different nawk command as below but none of them substitute the value of entry variable.
ls *.txt | while IFS='' read -r entry; do
#nawk '/<name>/{A=1;++i} A{print >> ("cmd"i"_"$entry)}... (9 Replies)
Discussion started by: mohtashims
9 Replies
3. Shell Programming and Scripting
On linux i have the below command working fine.
awk '/<app-deploy>/{A=1;++i} /<\/app-deploy>/{print >> "found"i".tmp";A=0} A{;print >> "found"i".tmp"}' deploy.xml
But the same is failing on Solaris
Output:
awk: syntax error near line 1
awk: bailing out near line 1
uname -a SunOS mymac 5.10... (5 Replies)
Discussion started by: mohtashims
5 Replies
4. Shell Programming and Scripting
I'm trying to change "F" to "G" in lines after the first one:
'FUE.SER' 5
1 1 F0501 F0401 F0502
2 1 F0301 E0501 F0201 E0502 F0302
3 1 F0503 E0503 E0301 E0201 E0302 E0504 F0504
4 1 F0402 F0202 E0202 F0101 E0203 F0203 F0403
5 1 F0505 E0505 E0303 E0204 E0304 E0506... (10 Replies)
Discussion started by: larrl
10 Replies
5. UNIX for Dummies Questions & Answers
I have a script like this running under OS X 10.8. The problem arises when the find command encounters a space in the path name. I need the "dir" variable as I'll be extending the script to more general use.
#!/bin/bash
CFS=$IFS
IFS=$(echo)
set dir = "/Users/apta/Library/Mail\... (3 Replies)
Discussion started by: apta
3 Replies
6. Shell Programming and Scripting
I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes
CC=`which gcc`
CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies
7. Shell Programming and Scripting
Using hp-ux's shell, I'm trying to echo a complex awk command into a script file for later use. But it fails on a newline character and splits the rest of the command onto the next line.
echo ' printf("%s: TOTAL = %18.0lf\n", FILENAME, TOTAL) >> "TOTAL.TXT";' >>awk.script
Looks... (3 Replies)
Discussion started by: Scottie1954
3 Replies
8. Shell Programming and Scripting
Hi all,
I want to get each line of a data file from position 464 plus 8 characters. I tried in two different ways, and the results were different. I'd like to know why.
First method, using awk:
awk '{print substr($0,464,8)}' CONCIL_VUELTA_ALF_100112_0801.okSecond method, using scripting:... (5 Replies)
Discussion started by: AlbertGM
5 Replies
9. Shell Programming and Scripting
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
Discussion started by: Cowardly
6 Replies
10. Shell Programming and Scripting
I have a csh that is called from autosys. It fails when it hits this code
env | grep Rep
if ( $status == 0 ) then
echo ""
else
setenv REP ""
endif
However if I run it from the command line, as opposed to from autosys (job schduler) it runs fine. I thought it might be some kind of... (2 Replies)
Discussion started by: gillbates
2 Replies