c shell 에서 * 문자 관련 문의사항입니다..

xtester의 이미지

aaa.lst 파일이 있습니다...

이 파일내용은

TYPE1 /aaaa/bbbb/cccc/dddd/ *
TYPE2 /aaaa/cccc/bbbb/ temp.txt

이렇게 되어있구요,,,

이 파일을 읽어 현재 디렉토리 밑에

bbbb/cccc/dddd/ 디렉토리와 cccc/bbbb/ 디렉토리를 만들고...

해당 파일일을 새로만든 디렉토리로 복사하는 스크립트를 만들고있습니다...

그런데 temp.txt 처럼 파일명을 주면 제대로 돌아가는데,, * 로 주면 에러가 발생하네요...ㅠ.ㅠ

스크립트 내용은..

set ORGIN_LIST = aaa.lst
set SRC_TYPE = `cat ${ORGIN_LIST} | awk '{print $1}'`
set SRC_PATHS = `cat ${ORGIN_LIST} | awk '{print $2}'`
set SRC_FILES = `cat ${ORGIN_LIST} | awk '{print $3}'`

해서 스크립트에서 TYPE 과 PATH, FILE 을 분리한후

$#SRC_PATHS 만큼 while 문을 돌립니다..

그런데,, 이 while 문안에서

디렉토리를 생성하고,,

set SRC_FILE = ${SRC_FILES[${CNT}]} 한후
이 $SRC_FILE 을 찍어보니 현재 경로에 파일명이 들어갑니다...

아니,, 이미 set 하는 시점에서 SRC_FILES 안에 이미 현재 경로에 파일목록이 다 들어가있네요...ㅠㅠ

저는 그냥 * 이게 들어가길 원한건데...

cp -f $SRC_FILE 대상디렉토리 이렇게 하려던건데...

이거 방법이 없나요??
그냥 문자로 * 가 들어가게 할수있는...

ihavnoth의 이미지

혹시 ..... mkdir -p 옵션 먹나요?

없음

xtester의 이미지

디렉토리 생성시 하위경로까지 잘 생성이 되는데요..

시노의 이미지

bash 에서 경험해 본 일입니다만 ;; *을 주게되면 쉘에서 자동으로 파일명을 친절하게(?) 넣어주더군요 ;

*글자를 원하시면 \* 처럼 익스케이프문자를 앞에다 넣어주시면됩니다..

근데 c shell 에서는 잘모르겠네요
------------------------------------------------
Wanting someone more than looking at yourself is called addiction

------------------------------------------------
Wanting someone more than looking at yourself is called addiction

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.