10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi I want to know how to handle the spaces in the below scenario.
I have a file (CON_zip_path_1.txt) which has some directory paths with spaces in directory names . My requirement is to unzip these zip files to
another path. Please see the code below and the error.
CON_zip_path_1.txt... (4 Replies)
Discussion started by: paul1234
4 Replies
2. UNIX for Dummies Questions & Answers
Hello
I've got a certain no. of files in a directory whose names I'm reading and redirecting into a temporary text file using the command below:
ls -l | grep ^- | awk '{print $9}'However, whenever the file names contain spaces the above command considers only the part of the file name up to... (5 Replies)
Discussion started by: S. BASU
5 Replies
3. Shell Programming and Scripting
I have a csv file called template.csv which has the following data
Name, Age, Height
Jessica Jesse, 18, 150
Now what I want to do is use a shell script to read the name age and height which looks like this:
#!bin/sh
INPUT='template.csv
while read Name Age Height
do
echo... (2 Replies)
Discussion started by: JSNY
2 Replies
4. Shell Programming and Scripting
consider the small piece of code
while read line
do
echo $line
done < example
content of example file
sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr
the output is like
sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr
the... (4 Replies)
Discussion started by: Kesavan
4 Replies
5. Shell Programming and Scripting
Hi,
I have a test.txt and would like to put in a different file but while putting in the other file, blank spaces are missing.
$ indicates blank spaces
filename: test.txt:
USA$$$840$$$$
Desired output
USA$$$840$$$$
Current output as per the following code.
while read j;
do... (3 Replies)
Discussion started by: techmoris
3 Replies
6. Shell Programming and Scripting
Hi,
I am reading data from a variable which has spaces in it. I want to get the data after first space, i.e. if my data line is "My Name is Ashish...", I want the data returned as "Name is Ashish". I am using #!/bin/sh shell. Please help me with the code to read the complete data after first... (8 Replies)
Discussion started by: gupt_ash
8 Replies
7. Shell Programming and Scripting
I want to be able to read in input which contain spaces and put that into an array. Each field should be delimeted by a space and should be a different array element. However I cant get it to work. any tips?
read input
//type field1 field2 field3
echo "$input"
array="$input"
Thanks in... (11 Replies)
Discussion started by: Calypso
11 Replies
8. Shell Programming and Scripting
Hi
I am trouble parsing through a file with spaces in the filename. I need to grab "supportIDPS/SCM/windows_install/file groups/dds.fgl" and then do a md5sum on it. I am using sh.
Any help is appreciated.
Here is an example of the input file:
7eedbc9f7902bf4c1878d9e571addf9a ... (4 Replies)
Discussion started by: jekl5
4 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I have a script that reads a file and echo it back to std out.
Test.txt
1aaaaaaaaaaa .
The script is ReadLine.sh
#!/bin/ksh
cat $1 | while read file
do
echo $file
done
I invoke the script as ReadLine.sh Test.txt
The output that I get is (1 Reply)
Discussion started by: aksarben
1 Replies
10. UNIX for Advanced & Expert Users
Please Help!!
Here is a very simplistic example of what I am trying to accomplish.
I need what I have inbetween the quotes to be read into the shell variable.
x="This is fun"
echo $x
The results of x from the above expression is:
This is fun
Notice the unix takes out the... (1 Reply)
Discussion started by: mjs3221
1 Replies