Hi all,
Does anyone know how to convert a good few files in a particular directory (unix) to dos files and place them in another directory?
I know this can be done with ux2dos but I am trying to come up with a shell script to do so
I have a few to questions pose in response first:-
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
Most importantly, What have you tried so far?
There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.
We're all here to learn and getting the relevant information will help us all.
I have a few to questions pose in response first:-
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
Most importantly, What have you tried so far?
There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.
We're all here to learn and getting the relevant information will help us all.
HPUX v11.3
I just need a good script that can do the above as I am not the best at shell scripting
We are all here to learn from each other, not just to be a free script writing service.
Whilst I would be happy to help (and the only possible payment would be you pressing the Thanks button) you need to show us what you have tried so far along with the errors so that we can suggest improvements.
There is no point in spoon feeding you an answer that you do not understand and cannot support when you need to adjust it in the future.
If you can't be bothered to try first (no matter how badly wrong it goes) and show us the attempt and the errors, then .........
i'm willing to provide a small script for you this time, once and explain it as much as i can.
Hopefully we shall see in the future will user lcclaj0 ask simple question again without any tries, but lets assume he is new in scripting and is looking for a simple example.
Directory /directoryforoutput (destination) will contain converted files with /directorywithunix (source) will contain original files, uneffected by operation (exception being modifed atime -access time, if used on filesystem, by default vxfs - yes.)
This is sample shell script with basic error handling.
Shell commands and constructs used :
1. Variable declaration (directories used INPUTDIR OUTPUTDIR)
2. Conditional operator ( || )
3. Test constructs ([ .. ]) # man test
4. for loop to iterate over the directory contents
5. ux2dos utility to convert format.
Script will not go into subdirectories or process files with dots in names e.g .config
i'm willing to provide a small script for you this time, once and explain it as much as i can.
Hopefully we shall see in the future will user lcclaj0 ask simple question again without any tries, but lets assume he is new in scripting and is looking for a simple example.
Directory /directoryforoutput (destination) will contain converted files with /directorywithunix (source) will contain original files, uneffected by operation (exception being modifed atime -access time, if used on filesystem, by default vxfs - yes.)
This is sample shell script with basic error handling.
Shell commands and constructs used :
1. Variable declaration (directories used INPUTDIR OUTPUTDIR)
2. Conditional operator ( || )
3. Test constructs ([ .. ]) # man test
4. for loop to iterate over the directory contents
5. ux2dos utility to convert format.
Script will not go into subdirectories or process files with dots in names e.g .config
Hope that helps.
Best regards
Peasant.
Hi all, so I tried with this script and share it to a directory shared by samba but when I go to open the file on my windows machine the file is still in unix format which is all over the place
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)