Running multiple files through shell script with a variable
Ok, so this question is probably much easier than I'm making it, and thus why I've spent almost 2 hours now on this . I'm trying to use a command that reads out specific data from a file and and saves it to another file. The code is only a few lines, and here it is below:
Basically put, this is meant to, from each of the 500 oldfiles(1oldfile, 2oldfile, 3oldfile, etc.), extract variable's data and save them to newfile1.txt, newfile2.txt, etc). But I just get one file created, called -x, which is just the variable data from the last oldfile. Thanks for your help in advance.
hey ctsgnb,
No, csh is not the required format; it can be just a regular sh script. I think I just used csh is because that's what I was taught in for shell type scripting.
I am working on script. it reads a file which contains multiple lines
Ex;
curl --write-out %{http_code} --silent --output /dev/null http://hostname:port/input=1
curl --write-out %{http_code} --silent --output /dev/null http://hostname:port/input=2
curl --write-out %{http_code} --silent ... (2 Replies)
I am not sure what I am doing wrong here. The code should work fine. I have been making small changes insuring that each new bit works. Now running my sed through multiple files I am getting incorrect output. Any help and instruction would be greatly appreciated.
The problem -
Generalize... (10 Replies)
Hi,
i use the below script to send a single file to remote server from linux.
ftp -nvi <<!EOF
open $Host_name
user $USER_ID $PWD
binary
mput $file_name
quit
!EOF (where i... (2 Replies)
Hey guys,
I'm really new to UNIX and shell scripting in general. For my internship I need to rename a bunch of files. Specifically, I need to change the first letter of each of the files to lowercase and I have to change the endings so they all basically look like "file_cone.jpg". I know I... (4 Replies)
Hi All,
I am a beginner for shell programming. I have a requirement to ftp multiple files. Here are the details.
I have around thiry files in one directory, I want a shell script which selects 5 files at a time and does ftp them to another host . After the transfer for first files is... (0 Replies)
Hi,
Can any one tell me if i can read two files in a shell script...
My actual requirement is to read the 1st text file and parse it to get the file code and use this file code to retrieve data from database and print the fetched data in the 2nd text file (I have parsed it and printed the... (2 Replies)
Hi!
I need help to create a shell script to search inside a file and then copy a portion of the search result as the new file name.
Basically I was hacked over the weekend and the genius wipe out my drive from my server. I was able to recover alot of files, but biggest problem Is now the... (15 Replies)
I am trying to make a script to convert drg files to wav and so far i have this
#!/bin/bash
drg2sbg "$*" -o "$*".sbg
sbagen -Wo "/home/nick/Desktop/I-Doser Wave Files/"$*"" "$*".sbg
rm "$*".sbg
cd "/home/nick/Desktop/I-Doser Wave Files"
rename 's/\.drg$/\.wav/' *.drg
exit
the drg2sbg and... (2 Replies)
hi,
how to send multiple files from the shell script
eg : i have
/home/adm/file1
/home/adm/file2
/home/adm/cfg
how can i attach these files in the mail ? (1 Reply)
:)
Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable.
like
#!/bin/ksh
v_shell_var=Hi
here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array).
Regards,
Div (4 Replies)