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 have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
3. Shell Programming and Scripting
Hi All,
Is it possible to grep for two files and assign their names to two separate variables with for loop? I am doing the below currently:
if
then
for fname in $( cd $dirA ; ls -tr | grep "^Ucountry_file$")
do
InFile=$dirA/$fname
... (4 Replies)
Discussion started by: swasid
4 Replies
4. Shell Programming and Scripting
I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies
5. Shell Programming and Scripting
Hi,
I have this code:
cat file.txt | awk -F, 'NR==1{print $6","$8","$10","$20","$21","$19}' > file.tmp
VAR1=`cat file.tmp | cut -d "," -f1`
VAR2=`cat file.tmp | cut -d "," -f2`
VAR3=`cat file.tmp | cut -d "," -f3`;
VAR4=`cat file.tmp | cut -d "," -f4`;
VAR5=`cat... (1 Reply)
Discussion started by: Tr0cken
1 Replies
6. 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
7. Shell Programming and Scripting
How do I assign values to reference variables?
I am assigning a variable name to --> $user_var
Then I am trying to change its underlying variable value by
$((user_var))=$user_value .. its failing,,
Please let me know if there is a way to do this dynamically..
FileA.props... (5 Replies)
Discussion started by: kchinnam
5 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
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
10. Shell Programming and Scripting
Hi,
I have some problem in assigning values to variables: This is what Iam literally doing:
i=0
input=test
temp$i = $input
In the sense, I try to assign the value in the variable input (ie., test) to another variable temp0 (since i is assigned 0, temp$i is temp0). Seems simple, but I get... (3 Replies)
Discussion started by: mohanprabu
3 Replies