I have written a shellscript which tries to pull a tar file from an ftp server and untar it locally. I need to extract specific files from the tar archive. The filename of the tarfile contains a date; I need to be able to select a tar file based on this date.
abc_myfile_$date.tar is the format of the file I am pulling from the ftp serve...
Hello,
I have some n number of files in a directory on my unix system . Is there a way to write a shellscript that will transfer all those files via scp to a remote system, i specify . Ill specify the password within the script, so that i dont have to enter it for each file.
Is there a way to do this ?
Thank You
...
hi
i am using this exec("du -sh -S ".$fileFlv.""); command in php to get size of a file all the things works fine but the problem at my end is i want only the size but it dispalys the size as well as name of the file
...
How do I write a shell script (bash on HPUX) that receives a string as an argument containing an asterisk?
e.g. myscript my_db_name "SELECT * FROM table;"
The asterisk gets expanded to all the file names in the current directory, also if I assign a variable like this.
DB_QUERY="$2"
echo $DB_QUERY
...
We've got a PHP application and want to count all the lines of code under a specific directory and its subdirectories. We don't need to ignore comments, as we're just trying to get a rough idea.
wc -l *.php
That command works great within a given directory, but ignores subdirectories. I was thinking this might work, but it is retur...
Need some help with this as my shell scripting skills are somewhat less than l337 :(
I need to gzip several files and then copy newer ones over the top from another location. I need to be able to call this script in the following manner from other scripts.
exec script.sh $oldfile $newfile
Can anyone point me in the right direction?
...
I'm writing a bash script and I have errexit set, so that the script will die if any command doesn't return a 0 exit code, i.e. if any command doesn't complete successfully. This is to make sure that my bash script is robust.
I have to mount some filesystems, copy some files over, the umount it. I'm putting a umount /mnt/temp at the sta...
I'm trying to do validation of a date entered as numbers only. (e.g. 09042009 as 09/04/2009)
The code now just checks the length of the date.
How would I validate not only length of the date entry but also that it is a real date? What would be the syntax for combining tests and regular expression?
Code as it exists now:
echo "Plea...
The Korn shell used to have a very useful option to cd for traversing similar directory structures e.g. given the following directorys
/home/sweet/dev/projects/trunk/projecta/app/models
/home/andy/dev/projects/trunk/projecta/app/models
Then if you were in the /home/sweet.... directory then you could change to the equivalent director...
I love this shortcut in borne shell, and want to find out if it is possible to simulate and/or have (perhaps to install an add-on or with a script) it in csh or tsch
thanks
...
I would like to get the most out of working in cch or tcsh shell.
I am looking for general tips (post them away), online tips, or book.
Thanks
...
Hi all!
I have an old project in our company that uses shell scripting a lot. Most popular commands are: grep, sed, sort. And it was OK for now. But one of the thing really bothers me. Sometimes we have an input data from other companies that is in csv-like formats. These input file are connected by several IDs like they are just a dump...
Hi I want to use gawk in a for loop. Something like this:
for i in gawk {print $1} | tr '\n' ' '
do something using $i
this isn't working of course. Ideas?
...
I have a korn shell script that is login into sqlplus and executing a script. Within the shell script I would like to capture the status code of the sql statement that was executed. Currently there is an error with sql I'm unable to capture it by checking $?.
How would I capture the success or error code from the sql statement and pass...
Good day members,
I have an input file which has rows of numerical digits ( close to 2000 rows ) I want to extract out " the second to the eight digit from the right" of every row of the numeric string into a separate file, with the result separated by a comma as shown.
Example: input.txt
00000000000001303275310752
000000000000018273...
Hi all -
I'm new to sed and awk - so I'm not really sure which is the most efficient way to go about this.
I'm looking to extract the first two letters of a string. I could do it if they were going to be same every time, but I can't seem to figure out how to just say,
Take n positions of this string from this larger string x.
IE.
US...
at the following path
\\ncsusnasent02.na.jnj.com\its_diq_na_win_dev\PowerCenter\infa_shared\WCPIT_BIO_EDW\SrcFiles\DDDMD\DDD.CLI026.WK0933.DDDMR45.001.head
I have one file
DDD.CLI026.WK0933.DDDMR45.001.head
if i open this file
i get data as following(in a single line)
HEADER0101IMS HEALTHDMD Weekly D DD.CLI026.WK0933.DDDMR4...
I tired head +10 and it didn't work. thanks
...
Basically I want do the following:
ls -l[+someflags] (or by some other means) that will only display files that are symbolic links
so the output would look
-rw-r--r-- 1 username grp size date-time filename -> somedir
-rw-r--r-- 1 username grp size date-time filename2 -> somsdfsdf
etc.
For example,
to show only direct...
there is one variable var=581
we need to copy the value of this variable at following address(location)
and value should appear in front of $$DRM45_RowCount
\ncsusnasent02.na.jnj.com\its_diq_na_win_dev\PowerCenter\infa_shared\WCPIT_BIO_EDW\PrmFiles\LND\IMS_FILE_to_LND.par
when I open this file IMS_FILE_to_LND.par it has data as follow...