10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So first: Sorry if the title is confusing...
I have a script I'm writing with a file with several names in it (some other info - but it's not really pertinent...) - I want to be allow the user to delete certain records, but I ran into a problem I'm not sure how to go about fixing.
If I were... (6 Replies)
Discussion started by: sabster
6 Replies
2. Shell Programming and Scripting
I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value.
I was thinking the best way to... (1 Reply)
Discussion started by: billprice13
1 Replies
3. Shell Programming and Scripting
Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file.
I've the following values stored in the file.. It consists of only two rows..
10
20
I want to assign the first row value to variable "n1" and the second row value to variable "n2"..
That is ... (3 Replies)
Discussion started by: abk07
3 Replies
4. Shell Programming and Scripting
I am looking to create a perl script which will take numbers from a simple text file, convert them from decimal to hex, and then rewrite those values in the file or create a new file with the hex numbers(whichever's easier).
My text document for example would be something as simple as
1312... (6 Replies)
Discussion started by: samh785
6 Replies
5. Shell Programming and Scripting
Hi Gurus,
I have a file named log with 2 lines
Each line is a file name. eg
$ cat log
monday
tuesday
I need to read log and assign each output(filename) to a different variable.
The following doesn't work:-
while read A B
do
echo " a is ${A} "
echo " b is ${B} "
done <... (6 Replies)
Discussion started by: wisdom
6 Replies
6. Shell Programming and Scripting
Hi,
In a script i am having trouble joining a variable to a file. for, example I read input from user as a variable a or b or c or d etc and want to join those to different files...
or
if user press a then it will open somefile.txt
if user press b then it will open otherfile.txt
any idea (4 Replies)
Discussion started by: Learnerabc
4 Replies
7. Shell Programming and Scripting
I was trying to store the number of lines in a file and store it in a file.after that i want to store the information in a file to a variable which is further used in the if loop to check certain condition.
#!/bin/bash
cat <file> | wc -l > count.txt
x="$count.txt";
i=10;
if ; then
cat... (10 Replies)
Discussion started by: sudhakaryadav
10 Replies
8. UNIX for Dummies Questions & Answers
HI
I have something like this in a file
ABC = 1
DEF = 2
GHI = 3
JKL = 4
MNO = 5
QRS = 6
TUV = 7
I need to assign ABC to V_abc (that is to a variable)
GHI to V_ghi (that is to another variable)
TUV to say V_tuv
... (6 Replies)
Discussion started by: ssuresh1999
6 Replies
9. Shell Programming and Scripting
I am missing something here, I have a file which contains only one line and that is either a number or character string. I am trying to read the file and assign that value to a variable and here it seems I am missing something and not getting the expected results... Here is the code :
#!/bin/ksh... (2 Replies)
Discussion started by: Vaddadi
2 Replies
10. Shell Programming and Scripting
Hi,
I'm trying to assign the permissions, owner and group of a file to seperate variables, but using
ls -l filename | awk '{print $1 "\t" $3 "\t" $4}'
gives the owner as tom.ja instead of tom.james
Is there any way to expand it so i get the full name, or is there an easier way to get them... (5 Replies)
Discussion started by: olimiles
5 Replies