Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to read files with spaces Post 302422528 by Lillyt on Tuesday 18th of May 2010 04:17:07 PM
Old 05-18-2010
Thanks. it works

Thank it works.
Can you tell me how the filename is extracted from the directory path from your code "newname=${fname##*/}"

---------- Post updated at 04:17 PM ---------- Previous update was at 04:13 PM ----------

Thank it works.

Can you tell me how the filename is extracted from the directory path from your code "newname=${fname##*/}"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Keep spaces with read command

Hi The following command read a string from the keyboard & echo it back. $ read S;echo "$S" ABCD ABCD As you see, the input has space. while it echo back the spaces are removed. Is there a way to keep the input intact and not removing any spaces? Also, the number of spaces may vary. ... (3 Replies)
Discussion started by: azmathshaikh
3 Replies

2. Shell Programming and Scripting

Read files including spaces

I am accessing two files. I am using read command to read from the files. For the first file, I need read the fields delimited by spaces, and for the other file, I need to read the whole line as a single field including the spaces. When I used read command for the second file, the spaces... (4 Replies)
Discussion started by: kumariak
4 Replies

3. Shell Programming and Scripting

How to read a line when it starts with spaces

Hi , I use read command to get the input text, When i try to get the line starting with spaces or ending with spaces it automatically truncates the spaces and displays the remaining content. Code i tried (UserInput.sh): #!/bin/bash echo -n "Enter some text > " read text echo "You... (3 Replies)
Discussion started by: PrakashChinna
3 Replies

4. Shell Programming and Scripting

ksh - read file with leading spaces

Hi, Could someone has any suggestions on this? When read a line from a file, I need to check the first char in the line, it could be a space or any char. But the leading spaces are removed by read. Thanks. (2 Replies)
Discussion started by: momi
2 Replies

5. Shell Programming and Scripting

Read variables contain spaces from text file

Dears, I developed a shell script to read varibales from text file as the following: cat /dev/null > /rename-OUT.txt while read line do set -- `echo $line` snmpset -c dslmibs $1 sysName.0 octetstring $2 after=$(snmpget -c dslmibs $1 sysName.0 | cut -d: -f3) echo "$1,$2,$after" >>... (1 Reply)
Discussion started by: ahmed.zaher
1 Replies

6. Shell Programming and Scripting

(g)awk how to preseve white spaces (FS characters) or read a right subpart of $0?

Hi, I am using gawk (--posix) for extracting some information from something like the following lines (in a text file): sms_snath_hp_C/CORE BUILD PREREQUISITE: total 1556 drwxrwxrwx 2 sn sn 4096 2008-06-27 08:31 ./ drwxrwxrwx 13 sn sn 4096 2009-07-22 14:48 ../ -rwxrwxrwx 1 sn sn ... (14 Replies)
Discussion started by: shri_nath
14 Replies

7. Shell Programming and Scripting

Read file line spaces

I have a script which read a file it does while read -r line, then i echo line out echo "$line" Problem is the echo does not echo space and tabs at the end of each line. How do i get the end of line space as well (6 Replies)
Discussion started by: kelseyh
6 Replies

8. Shell Programming and Scripting

how to read blank spaces

hi i have a file which store some data.the contents of my file is data1:data2 data3:data4 i have a script which read this file correct="$(cat /root/sh | cut -d: -f1)" i used this syntax..please help me which syntax is used to read blank spaces.and then remove it and after that how to read... (1 Reply)
Discussion started by: shubhig15
1 Replies

9. Shell Programming and Scripting

Having a for loop read in lines with spaces?

Is this possible? I have a for loop in a shell script reading a list, but I want each line to be a loop, not each thing with a space. Here is the example: HOSTLIST="\ 1.2.3.4 serverA 1.2.3.5 serverB" for NBUHOST in `echo $HOSTLIST` do ssh ${SERVERNAME} "echo "${NBUHOST}"... (3 Replies)
Discussion started by: LordJezoX
3 Replies

10. Shell Programming and Scripting

Bash - read white spaces

Hello! I have one problem with my bash script - I would like to be able to read white space characters from stdin (for example single " ") - can I acomplish that somehow? I need to read only one character at the time, so I use read -s -n 1 var but it doesn't work for whitespaces apparently. ... (3 Replies)
Discussion started by: xqwzts
3 Replies
VRENAME(1p)						User Contributed Perl Documentation					       VRENAME(1p)

NAME
vrename - change signal names across many Verilog files SYNOPSIS
vrename <filename_or_directory>... DESCRIPTION
Vrename will allow a signal to be changed across all levels of the design hierarchy, or to create a cross reference of signal names. (It actually includes module names, macros, and other definitions, so those can be changed too.) Vpm uses a three step process. First, use vrename --list [<file.v>...] [<directory>....] This reads the specified files, or all files below the specified directory, and creates a signals.vrename file. Now, edit the signals.vrename file manually to specify the new signal names. Then, use vrename --change [<file.v>...] [<directory>....] ARGUMENTS
vrename takes the following arguments: --help Displays this message and program version and exits. --version Displays program version and exits. --change Take the signals file signals.vrename in the current directory and change the signals in the design as specified by the signals file. Either --list or --change must be specified. --changefile {file} Use the given filename instead of "signals.vrename". --changelang Include in the signals.vrename file the template needed to change the language standard for the file. For the first run, use "--list --changelang" and --language to specify the file's original language, then rerun with the "--change" option. The files will get escaped identifiers for the most recent Verilog standard. For example with --language 1364-2005, "do" will become "do ". --crypt With --list, randomize the signal renames. With --change, compress spaces and comments and apply those renames listed in the file (presumably created with vrename --list --crypt). The comment /*ENCRYPT_ME*/ must be included in all files that need to be encrypted, or use the --cryptall flag. If a signal should not be encrypted, it can simply be set in the signals.vrename list to be changed to itself. After encrypting, you may want to save the signals.vrename file so you have a key for decoding, and also so that it may be used for the next encryption run. When used in this way for the next encryption run, only new signals will get new encryptions, all other encryptions will be encrypted the same. --cryptall As with --crypt, but put cryptic names into signals.vrename even if the file does not include ENCRYPT_ME. Generally you will then need to edit the signals.vrename file manually to exclude any top level signals that should be preserved. --keywords Include keywords in the renaming list. Default is to ignore keywords, as changing a keyword will probably result in unrunnable code, however, occasionally it may be necessary to rename signals which happen to match the name of keywords recently added to the language (such as 'bit'). --language <1364-1995|1364-2001|1364-2005|1800-2005|1800-2009> Set the language standard for the files. This determines which tokens are signals versus keywords, such as the ever-common "do" (data- out signal, versus a do-while loop keyword). --list Create a list of signals in the design and write to signals.vrename. Either --list or --change must be specified. --nowrite Don't write the actual changes, just report the files that would be changed. --o {dir} Use the given directory for output instead of the current directory. --read Read the changes list, allows --list to append to the changes already read. --xref Include a cross reference of where the signals are used. --list must also be specified. DISTRIBUTION
Verilog-Perl is part of the <http://www.veripool.org/> free Verilog EDA software tool suite. The latest version is available from CPAN and from http://www.veripool.org/verilog-perl <http://www.veripool.org/verilog-perl>. Copyright 2000-2012 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. AUTHORS
Wilson Snyder <wsnyder@wsnyder.org> SEE ALSO
Verilog-Perl, Verilog::Parser perl v5.14.2 2012-05-04 VRENAME(1p)
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy