Hello, I've just started with shell scripting, and I need som assistance!
Basicly what I want to do is copy names from one file to another, when running the scrip the user should be asked about the status of these names.
Let me demonstrate:
file:
// when the script is running
newfile:
I know how to copy a file, but I really don't even know where to start here! Help is appreciated!
Last edited by Don Cragun; 03-25-2014 at 06:41 PM..
Reason: Add CODE tags.
Is this a homework assignment?
What shell are you using?
Have you read the description of the read and printf built-in utilities on your shell's man page?
Is this a homework assignment?
What shell are you using?
Have you read the description of the read and printf built-in utilities on your shell's man page?
I am using the bash shell in ubuntu, it's an exercise, I have not read the printf I will do it now, thx
Well, I have learned how to copy from one file to another, but I'd like to know how to add a field in the new file, depending on what the user enters. I understand I might jump into things alittle fast.. :/ so if you have tips on tutorials that be great
In a while loop we read the input file line by line, and write each line to the output file.
We associate descriptors 3 & 4 rather than the default 0 & 1, so another read/print (for interactive i/o) won't interfere
Last edited by MadeInGermany; 03-26-2014 at 09:45 AM..
Reason: 0 & 1 not 1 & 2
These 2 Users Gave Thanks to MadeInGermany For This Post:
In a while loop we read the input file line by line, and write each line to the output file.
We associate descriptors 3 & 4 rather than the default 0 & 1, so another read/print (for interactive i/o) won't interfere
This was a huge help, ty! I can now finally continue with this script! (.. don't know if I should be happy or upset for making it look so easy )
Hi all,
How to pass the command line argument to a sql file
Script:
#!/bin/ksh
if ] ; then
test.sql
fi
My Sql Informix DB:
echo "select * from table where col1 = 2234
and col2 = '$3'"|dbaccess ddname
But im getting `:' unexpected error (5 Replies)
Hello All,
I am trying to find a file name with .sh exention from a list of .dat files inside a directory.
find /app/folder1/* -name '*.dat'| xargs grep '.sh'
ksh: /usr/local/bin/find: arg list too long
Please help me finding the command.
Thanks (3 Replies)
Hi experts
cp bin root src /mnt
but not copy bin/bigfile
any help?
( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum)
Thanks (6 Replies)
Hi,
When i am running a script it considers the below as mulitple arguments.
There is any command which can ignore the spaces.
I tried by using sed like below to ignore but it doesnt work.
sed 's/ /\\ /g'100% Haddock Fillets Battered 500G-small.gif
~vino (3 Replies)
Hi,
Help. I have a file that contains a list of users in a file. I want to cat the content of the file and feed it into sed to a preformated report. The error I got is "ksh: /usr/bin/sed: arg list too long" My method below.
A=`cat FILE1.txt`
B=`echo $A`
sed "s#USERLIST#$B#" FILE2 >... (2 Replies)
Aix 5.2 on a P510 RS6000
My /usr filesystem is sized at 3.8 gb. Check me if I'm wrong here but this should be enough space for /usr?
When I installed the o/s I just followed the defaults, didn't add any 3rd party apps, least that I know of.
My problem is that it's running at 90% capacity. ... (2 Replies)
I wrote a script like
#!/bin/bash
echo $1 > temp
cat $2 >> temp
mv temp $2
now I have problem appending the above script(only using bash shell) so that it now inserts the first argument into the middle of the file.
I have tried using $(('wc -l < file' / 2 ))
but invain so could any one... (4 Replies)